X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/6ccb42bd405aa3588930073b79d7c469fa49579f..f968cbbb699423fa252994ff42de77f8671ac7eb:/src/xbt/xbt_os_thread.c diff --git a/src/xbt/xbt_os_thread.c b/src/xbt/xbt_os_thread.c index 8690348936..3b58603ffa 100644 --- a/src/xbt/xbt_os_thread.c +++ b/src/xbt/xbt_os_thread.c @@ -2,7 +2,7 @@ /* Used in RL to get win/lin portability, and in SG when CONTEXT_THREAD */ /* in SG, when using HAVE_UCONTEXT_CONTEXTS, xbt_os_thread_stub is used instead */ -/* Copyright (c) 2007-2017. The SimGrid Team. +/* Copyright (c) 2007-2018. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -162,7 +162,7 @@ xbt_os_thread_t xbt_os_thread_create(const char *name, pvoid_f_pvoid_t start_ro * * If pthread_setaffinity_np is not usable on that (non-gnu) platform, this function does nothing. */ -int xbt_os_thread_bind(xbt_os_thread_t XBT_ATTRIB_UNUSED thread, int XBT_ATTRIB_UNUSED cpu) +int xbt_os_thread_bind(XBT_ATTRIB_UNUSED xbt_os_thread_t thread, XBT_ATTRIB_UNUSED int cpu) { int errcode = 0; #if HAVE_PTHREAD_SETAFFINITY @@ -252,6 +252,12 @@ void xbt_os_thread_key_create(xbt_os_thread_key_t* key) xbt_assert(errcode==0 , "pthread_key_create failed"); } +void xbt_os_thread_key_destroy(xbt_os_thread_key_t key) +{ + int errcode = pthread_key_delete(key); + xbt_assert(errcode == 0, "pthread_key_delete failed"); +} + void xbt_os_thread_set_specific(xbt_os_thread_key_t key, void* value) { int errcode = pthread_setspecific(key, value);