mirror of https://github.com/flysand7/ciabatta.git
threads test
This commit is contained in:
parent
9bd52d3145
commit
c02862b550
|
@ -16,19 +16,19 @@ int f(void* thr_data) {
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
tss_create(&key, NULL);
|
tss_create(&key, NULL);
|
||||||
// thrd_t thread;
|
thrd_t thread;
|
||||||
// int status = thrd_create(&thread, f, NULL);
|
int status = thrd_create(&thread, f, NULL);
|
||||||
// if(status == thrd_error) {
|
if(status == thrd_error) {
|
||||||
// puts("Failed creating threads");
|
puts("Failed creating threads");
|
||||||
// }
|
}
|
||||||
// for(int n = 0; n < 10; ++n) {
|
for(int n = 0; n < 10; ++n) {
|
||||||
// counter++;
|
counter++;
|
||||||
// }
|
}
|
||||||
tss_set(key, "Thread 1 finished");
|
tss_set(key, "Thread 1 finished");
|
||||||
// int res;
|
int res;
|
||||||
// if(thrd_join(thread, &res) == thrd_error) {
|
if(thrd_join(thread, &res) == thrd_error) {
|
||||||
// puts("Failed waiting on thread");
|
puts("Failed waiting on thread");
|
||||||
// }
|
}
|
||||||
puts(tss_get(key));
|
puts(tss_get(key));
|
||||||
tss_delete(key);
|
tss_delete(key);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue