static void tt_schedule_remove (void *arg) { #ifdef TT_SUPPORT_DUMP_THREAD listDetach (&g_thread_current->list_threads); #endif // TT_SUPPORT_STACK_CHECK listDetach (&g_thread_current->list_schedule); g_thread_current->wait_parent = NULL; #ifdef TT_SUPPORT_MUTEX listDetach (&g_thread_current->list_wait_head); listDetach (&g_thread_current->list_wait_node); #endif // TT_SUPPORT_MUTEX __tt_schedule (); }
void vjpegClearBuffer (void) { sysDisableIRQ (); while (1) { VP_BUFFER_JPEG_ENCODER_T *pBitstream; pBitstream = vjpegGetEncBuffer (); if (pBitstream == NULL) break; else { listDetach (&pBitstream->list); vjpegFreeEncBuffer (pBitstream); } } if (g_vpJPEG.pJPEGEncodeBuffer != NULL) { bufEncJpegDecRef (g_vpJPEG.pJPEGEncodeBuffer); g_vpJPEG.pJPEGEncodeBuffer = NULL; } sysEnableIRQ (); //iothread_ClearNotify(MEDIA_TYPE_JPEG); }
void thread_write_audio(cyg_addrword_t data) { VP_BUFFER_TEST_AUDIO_BITSTREAM_T *ptestaudio; IO_THREAD_READ_T readarg; while(1) { cyg_semaphore_wait(&g_testaudio.pcAudio.consumer); if (!listIsEmpty (&g_testaudio.listAudio)) { ptestaudio = GetParentAddr (g_testaudio.listAudio.pNext, VP_BUFFER_TEST_AUDIO_BITSTREAM_T, list); listDetach(&ptestaudio->list); } else { diag_printf("No auido data???\n"); while(1); } readarg.txbuf = ptestaudio->aucAudio; readarg.txlen = ptestaudio->iAudioLen; readarg.mediatype = MEDIA_TYPE_AUDIO; iothread_Write(&readarg); bufTestAudioDecRef(ptestaudio); cyg_semaphore_post(&g_testaudio.pcAudio.producer); } cyg_thread_exit(); }
static void tt_create_thread_nop (void) { TT_THREAD_T *thread = tt_thread_create ("__tt_nop", 0, g_thread_nop_buffer, sizeof (g_thread_nop_buffer), tt_thread_nop_entry, NULL); listDetach (&thread->list_schedule); thread->wait_parent = NULL; //sysSafePrintf("%d\n", sizeof (g_thread_nop_buffer)); }
/* Return: NULL, failed other, the message poped. Return pointer just indicates if a message was popped. Do not use it for other purpose. */ static TT_BMSG_T *tt_bmsg_pop (TT_BMSG_QUEUE_T *msg_queue, void **msg_data) { LIST_T *msg_node = listGetNext (&msg_queue->queue.msg_used); if (msg_node == &msg_queue->queue.msg_used) return NULL; else { TT_BMSG_T *msg = GetParentAddr (msg_node, TT_BMSG_T, list); listDetach (msg_node); if (msg_data != NULL) *msg_data = msg->msg_data; return msg; } }
/* Return: NULL, failed other, the message poped. Return pointer just indicates if a message was popped. Do not use it for other purpose. */ static TT_MSG_T *tt_msg_pop (TT_MSG_QUEUE_T *msg_queue, FUN_TT_MSG_PROC *msg_proc, void **msg_data) { LIST_T *msg_node = listGetNext (&msg_queue->msg_used); if (msg_node == &msg_queue->msg_used) return NULL; else { TT_MSG_T *msg = GetParentAddr (msg_node, TT_MSG_T, list); listDetach (msg_node); if (msg_proc != NULL) *msg_proc = msg->msg_proc; if (msg_data != NULL) *msg_data = msg->msg_data; memDel (msg_queue->msg_buffer, msg_node); return msg; } }