Answer the question
In order to leave comments, you need to log in
Do linux processes/threads have a wait flag feature?
Hello! Interested in such a moment, is there a function in linux that suspends the execution of a process / thread until a certain flag is set.
Example from eCos:
#define OUR_EVENT_TYPE 0x1
//определение нашего флага
static cyg_flag_t our_event;
//функция потока
void our_thread(cyg_addrword_t data)
{
while (1) {
(void)cyg_flag_wait(&our_event, OUR_EVENT_TYPE ,CYG_FLAG_WAITMODE_OR | CYG_FLAG_WAITMODE_CLR);
//дальше что-то выполняется
...
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question