From 4b9fef86b73d5262c31dab7e82aaed3f2d62e660 Mon Sep 17 00:00:00 2001 From: mquinson Date: Mon, 9 Jul 2007 16:30:13 +0000 Subject: [PATCH] This file is a stub for XBT, it has nothing to do in the gras/ dir git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3695 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- .../sg_stubs.c => xbt/xbt_os_thread_stubs.c} | 63 ++++++++++--------- 1 file changed, 33 insertions(+), 30 deletions(-) rename src/{gras/sg_stubs.c => xbt/xbt_os_thread_stubs.c} (58%) diff --git a/src/gras/sg_stubs.c b/src/xbt/xbt_os_thread_stubs.c similarity index 58% rename from src/gras/sg_stubs.c rename to src/xbt/xbt_os_thread_stubs.c index cf73c061e2..7a041bdb78 100644 --- a/src/gras/sg_stubs.c +++ b/src/xbt/xbt_os_thread_stubs.c @@ -1,6 +1,9 @@ /* $Id$ */ -/* rl_gras.c -- empty body of functions used in SG, but harmful in RL */ +/* xbt_os_thread_stub -- empty functions used in SG, but harmful in RL */ +/* More specifically, it is loaded by xbt/context.c when CONTEXT_UCONTEXT */ +/* When CONTEXT_THREAD, xbt_os_thread is loaded instead (to get real func) */ +/* In RL, xbt_os_thread is part of GRAS_RL_SRC */ /* Copyright (c) 2007 Martin Quinson. */ /* All rights reserved. */ @@ -10,7 +13,7 @@ #include "xbt_modinter.h" #include "xbt/sysdep.h" -#include "xbt/xbt_thread.h" +#include "xbt/xbt_os_thread.h" #include "portable.h" /* CONTEXT_THREADS */ #ifndef CONTEXT_THREADS @@ -20,77 +23,77 @@ */ /* Mod_init/exit mecanism */ -void xbt_thread_mod_init(void) {} +void xbt_os_thread_mod_init(void) {} -void xbt_thread_mod_exit(void) {} +void xbt_os_thread_mod_exit(void) {} /* Main functions */ -xbt_thread_t xbt_thread_create(pvoid_f_pvoid_t start_routine,void* param) { +xbt_os_thread_t xbt_os_thread_create(pvoid_f_pvoid_t start_routine,void* param) { xbt_backtrace_display(); - xbt_die("No pthread in SG when compiled against the ucontext (xbt_thread_create)"); + xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_thread_create)"); } -void xbt_thread_exit(int *retcode){ +void xbt_os_thread_exit(int *retcode){ xbt_backtrace_display(); - xbt_die("No pthread in SG when compiled against the ucontext (xbt_thread_exit)"); + xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_thread_exit)"); } -xbt_thread_t xbt_thread_self(void){ +xbt_os_thread_t xbt_os_thread_self(void){ xbt_backtrace_display(); - xbt_die("No pthread in SG when compiled against the ucontext (xbt_thread_self)"); + xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_thread_self)"); } -void xbt_thread_yield(void){ +void xbt_os_thread_os_yield(void){ xbt_backtrace_display(); - xbt_die("No pthread in SG when compiled against the ucontext (xbt_thread_yield)"); + xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_thread_yield)"); } -xbt_mutex_t xbt_mutex_init(void){ +xbt_os_mutex_t xbt_os_mutex_init(void){ xbt_backtrace_display(); - xbt_die("No pthread in SG when compiled against the ucontext (xbt_mutex_init)"); + xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_mutex_init)"); } -void xbt_mutex_lock(xbt_mutex_t mutex){ +void xbt_os_mutex_lock(xbt_os_mutex_t mutex){ xbt_backtrace_display(); - xbt_die("No pthread in SG when compiled against the ucontext (xbt_mutex_lock)"); + xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_mutex_lock)"); } -void xbt_mutex_unlock(xbt_mutex_t mutex){ +void xbt_os_mutex_unlock(xbt_os_mutex_t mutex){ xbt_backtrace_display(); - xbt_die("No pthread in SG when compiled against the ucontext (xbt_mutex_unlock)"); + xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_mutex_unlock)"); } -void xbt_mutex_destroy(xbt_mutex_t mutex){ +void xbt_os_mutex_destroy(xbt_os_mutex_t mutex){ xbt_backtrace_display(); - xbt_die("No pthread in SG when compiled against the ucontext (xbt_mutex_destroy)"); + xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_mutex_destroy)"); } -xbt_thcond_t xbt_thcond_init(void){ +xbt_os_cond_t xbt_os_cond_init(void){ xbt_backtrace_display(); - xbt_die("No pthread in SG when compiled against the ucontext (xbt_thcond_init)"); + xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_cond_init)"); } -void xbt_thcond_wait(xbt_thcond_t cond, xbt_mutex_t mutex){ +void xbt_os_cond_wait(xbt_os_cond_t cond, xbt_os_mutex_t mutex){ xbt_backtrace_display(); - xbt_die("No pthread in SG when compiled against the ucontext (xbt_thcond_wait)"); + xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_cond_wait)"); } -void xbt_thcond_signal(xbt_thcond_t cond){ +void xbt_os_cond_signal(xbt_os_cond_t cond){ xbt_backtrace_display(); - xbt_die("No pthread in SG when compiled against the ucontext (xbt_thcond_signal)"); + xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_cond_signal)"); } -void xbt_thcond_broadcast(xbt_thcond_t cond){ +void xbt_os_cond_broadcast(xbt_os_cond_t cond){ xbt_backtrace_display(); - xbt_die("No pthread in SG when compiled against the ucontext (xbt_thcond_broadcast)"); + xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_cond_broadcast)"); } -void xbt_thcond_destroy(xbt_thcond_t cond){ +void xbt_os_cond_destroy(xbt_os_cond_t cond){ xbt_backtrace_display(); - xbt_die("No pthread in SG when compiled against the ucontext (xbt_thcond_destroy)"); + xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_cond_destroy)"); } -- 2.20.1