static void* thread_sema_give_10Hz(void *arg) { while(1){ GL_TraceInfo("[%s]GL_SemaphoreGive\n", __FUNCTION__); if(GL_SUCCESS != GL_SemaphoreGive(cross_semid)){ GL_TraceError("[%s-%4d]GL_SemaphoreGive fail\n", __FUNCTION__, __LINE__); exit(1); // } GL_TaskSleep(100); } return NULL; }
static void entry1(void *arg) { char msg[215]; GL_Status_t res; memset(msg, 'A', sizeof(msg)); while (1) { res = GL_QueueSend(queue_id1, (void *)msg, 215); GL_TaskSleep(80); diag_printf(">>>>sent one\n"); } }
static void* thread_sema_take_10Hz(void *arg) { while(1){ GL_TraceInfo("[%s]GL_SemaphoreTake\n", __FUNCTION__); if(GL_SUCCESS != GL_SemaphoreTake(cross_semid, GL_INFINITE_WAIT)){ GL_TraceError("[%s-%4d]GL_SemaphoreTake GL_INFINITE_WAIT fail\n", __FUNCTION__, __LINE__); exit(1); // } GL_TaskSleep(100); } return NULL; }