sc/condition/cond_example.c
2020-12-27 16:02:35 +03:00

17 lines
275 B
C

#include "sc_cond.h"
#include <stdio.h>
int main()
{
struct sc_cond cond;
sc_cond_init(&cond);
sc_cond_signal(&cond, "test"); // Call this on thread-1
char* p = sc_cond_wait(&cond); // Call this on another thread.
printf("%s \n", p);
return 0;
}