ARGOBOTS  dce6e727ffc4ca5b3ffc04cb9517c6689be51ec5
abtd_ythread.c
Go to the documentation of this file.
1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
2 /*
3  * See COPYRIGHT in top-level directory.
4  */
5 
6 #include "abti.h"
7 
8 void ABTD_ythread_func_wrapper(ABTD_ythread_context *p_arg)
9 {
10  ABTD_ythread_context *p_ctx = p_arg;
11  ABTI_ythread *p_ythread = ABTI_ythread_context_get_ythread(p_ctx);
12  p_ythread->thread.f_thread(p_ythread->thread.p_arg);
13 
14  ABTI_xstream *p_local_xstream = p_ythread->thread.p_last_xstream;
15  ABTI_ythread_exit(p_local_xstream, p_ythread);
16 }
17 
18 void ABTD_ythread_print_context(ABTI_ythread *p_ythread, FILE *p_os, int indent)
19 {
20  ABTD_ythread_context *p_ctx = &p_ythread->ctx;
21  fprintf(p_os, "%*sp_ctx : %p\n", indent, "", (void *)p_ctx);
22  fprintf(p_os, "%*sp_link : %p\n", indent, "",
23  (void *)ABTD_atomic_acquire_load_ythread_context_ptr(
24  &p_ctx->p_link));
25  fflush(p_os);
26 }
abti.h