mirror of
https://github.com/tezc/sc.git
synced 2025-01-28 07:03:06 +08:00
c221478638
* Switched to tabs for indentation, amalgamation tool works with tabs only
20 lines
322 B
C
20 lines
322 B
C
#include "sc_cond.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
int main()
|
|
{
|
|
struct sc_cond cond;
|
|
|
|
sc_cond_init(&cond); // Init once
|
|
|
|
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); // Prints "test"
|
|
|
|
sc_cond_term(&cond); // Destroy
|
|
|
|
return 0;
|
|
}
|