summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
ddccd2f)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@4014
48e7efb5-ca39-0410-a469-
dd3cf9ba447f
XBT_PUBLIC(xbt_thread_t) xbt_thread_create(const char *name, void_f_pvoid_t start_routine,void* param);
XBT_PUBLIC(void) xbt_thread_exit();
XBT_PUBLIC(xbt_thread_t) xbt_thread_self(void);
XBT_PUBLIC(xbt_thread_t) xbt_thread_create(const char *name, void_f_pvoid_t start_routine,void* param);
XBT_PUBLIC(void) xbt_thread_exit();
XBT_PUBLIC(xbt_thread_t) xbt_thread_self(void);
+ XBT_PUBLIC(const char*) xbt_thread_name(xbt_thread_t t);
+ XBT_PUBLIC(const char*) xbt_thread_self_name(void);
/* xbt_thread_join frees the joined thread (ie the XBT wrapper around it, the OS frees the rest) */
XBT_PUBLIC(void) xbt_thread_join(xbt_thread_t thread);
/* Ends the life of the poor victim (not always working if it's computing, but working if it's blocked in the OS) */
/* xbt_thread_join frees the joined thread (ie the XBT wrapper around it, the OS frees the rest) */
XBT_PUBLIC(void) xbt_thread_join(xbt_thread_t thread);
/* Ends the life of the poor victim (not always working if it's computing, but working if it's blocked in the OS) */
XBT_PUBLIC(xbt_os_thread_t) xbt_os_thread_create(const char *name,pvoid_f_pvoid_t start_routine,void* param);
XBT_PUBLIC(void) xbt_os_thread_exit(int *retcode);
XBT_PUBLIC(xbt_os_thread_t) xbt_os_thread_self(void);
XBT_PUBLIC(xbt_os_thread_t) xbt_os_thread_create(const char *name,pvoid_f_pvoid_t start_routine,void* param);
XBT_PUBLIC(void) xbt_os_thread_exit(int *retcode);
XBT_PUBLIC(xbt_os_thread_t) xbt_os_thread_self(void);
+ XBT_PUBLIC(const char*) xbt_os_thread_self_name(void);
+ XBT_PUBLIC(const char*) xbt_os_thread_name(xbt_os_thread_t);
/* xbt_os_thread_join frees the joined thread (ie the XBT wrapper around it, the OS frees the rest) */
XBT_PUBLIC(void) xbt_os_thread_join(xbt_os_thread_t thread,void ** thread_return);
XBT_PUBLIC(void) xbt_os_thread_yield(void);
/* xbt_os_thread_join frees the joined thread (ie the XBT wrapper around it, the OS frees the rest) */
XBT_PUBLIC(void) xbt_os_thread_join(xbt_os_thread_t thread,void ** thread_return);
XBT_PUBLIC(void) xbt_os_thread_yield(void);
THROW0(system_error,errcode,"pthread_key_create failed for xbt_self_thread_key");
main_thread=xbt_new(s_xbt_os_thread_t,1);
THROW0(system_error,errcode,"pthread_key_create failed for xbt_self_thread_key");
main_thread=xbt_new(s_xbt_os_thread_t,1);
+ main_thread->name = (char*)"main";
main_thread->start_routine = NULL;
main_thread->param = NULL;
main_thread->exception = xbt_new(ex_ctx_t, 1);
main_thread->start_routine = NULL;
main_thread->param = NULL;
main_thread->exception = xbt_new(ex_ctx_t, 1);
+const char* xbt_os_thread_name(xbt_os_thread_t t) {
+ return t->name;
+}
+
+const char* xbt_os_thread_self_name(void) {
+ xbt_os_thread_t self = xbt_os_thread_self();
+ return self?self->name:"main";
+}
void
xbt_os_thread_join(xbt_os_thread_t thread,void ** thread_return) {
void
xbt_os_thread_join(xbt_os_thread_t thread,void ** thread_return) {
+const char* xbt_os_thread_name(xbt_os_thread_t t) {
+ return t->name;
+}
+
+const char* xbt_os_thread_self_name(void) {
+ xbt_os_thread_t t = xbt_os_thread_self();
+ return t?t->name:"main";
+}
+
void
xbt_os_thread_join(xbt_os_thread_t thread,void ** thread_return) {
void
xbt_os_thread_join(xbt_os_thread_t thread,void ** thread_return) {
+const char* xbt_thread_name(xbt_thread_t t) {
+ return xbt_os_thread_name(t->os_thread);
+}
+
+const char* xbt_thread_self_name(void) {
+ return xbt_os_thread_self_name();
+}
+
void
xbt_thread_join(xbt_thread_t thread) {
DEBUG1("Join thread %p",thread);
void
xbt_thread_join(xbt_thread_t thread) {
DEBUG1("Join thread %p",thread);
+const char* xbt_thread_name(xbt_thread_t t) {
+ return t->name;
+}
+
+const char* xbt_thread_self_name(void) {
+ return xbt_thread_self()->name;
+}
+
+
void
xbt_thread_join(xbt_thread_t thread) {
THROW_UNIMPLEMENTED; /* FIXME */
void
xbt_thread_join(xbt_thread_t thread) {
THROW_UNIMPLEMENTED; /* FIXME */