I want to wait one thread of 2 thread that executed in a Simultaneous simulator until a condition has been occurred, may be the condition occurred after 1000 or more cycles
Using Semaphore for signalling. Example (application clean exit) as below:
Declare in header
static sem_t semPrepareExit; //declaration
In source (main thread);
sem_init(&semPrepareExit, 0, 0); ///semaphore initialized
...
///now wait for the signal on the semaphore, to proceed hereforth
sem_post(&semPrepareExit);
/// cleanup ahead
...
In source, (spawned-thread);
...
sem_post(&semPrepareExit);
Now, as soon as you signal on the semaphore using "sem_post". The main-thread will receive the signal at the wait-node/point, and will proceed, there-forth.