From 4b754cbe4ec669846baeee13c6362184019c5bbd Mon Sep 17 00:00:00 2001 From: mquinson Date: Mon, 12 Mar 2007 15:00:09 +0000 Subject: [PATCH] proper file name for the stubs not used in either SG or RL git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3241 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/gras/{rl_gras.c => rl_stubs.c} | 3 +- src/gras/sg_stubs.c | 84 ++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+), 1 deletion(-) rename src/gras/{rl_gras.c => rl_stubs.c} (80%) create mode 100644 src/gras/sg_stubs.c diff --git a/src/gras/rl_gras.c b/src/gras/rl_stubs.c similarity index 80% rename from src/gras/rl_gras.c rename to src/gras/rl_stubs.c index f61edd56da..f9474fe6e6 100644 --- a/src/gras/rl_gras.c +++ b/src/gras/rl_stubs.c @@ -1,6 +1,6 @@ /* $Id$ */ -/* rl_gras.c -- empty body of functions used in SG, but harmful in RL */ +/* rl_stubs.c -- empty body of functions used in SG, but harmful in RL */ /* Copyright (c) 2007 Martin Quinson. */ /* All rights reserved. */ @@ -9,6 +9,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "xbt_modinter.h" +#include "xbt/sysdep.h" void xbt_context_init(void) {} diff --git a/src/gras/sg_stubs.c b/src/gras/sg_stubs.c new file mode 100644 index 0000000000..9b1544a586 --- /dev/null +++ b/src/gras/sg_stubs.c @@ -0,0 +1,84 @@ +/* $Id$ */ + +/* rl_gras.c -- empty body of functions used in SG, but harmful in RL */ + +/* Copyright (c) 2007 Martin Quinson. */ +/* All rights reserved. */ + +/* This program is free software; you can redistribute it and/or modify it + * under the terms of the license (GNU LGPL) which comes with this package. */ + +#include "xbt_modinter.h" +#include "xbt/sysdep.h" +#include "xbt/xbt_thread.h" +#include "portable.h" /* CONTEXT_THREADS */ + +#ifndef CONTEXT_THREADS + +/* xbt_threads is loaded in libsimgrid when they are used to implement the xbt_context. + * The decision (and the loading) is made in xbt/context.c. + */ + +/* Mod_init/exit mecanism */ +void xbt_thread_mod_init(void) {} + +void xbt_thread_mod_exit(void) {} + + +/* Main functions */ + +xbt_thread_t xbt_thread_create(pvoid_f_pvoid_t start_routine,void* param) { + xbt_die("No pthread in SG when compiled against the ucontext"); +} + +void xbt_thread_exit(int *retcode){ + xbt_die("No pthread in SG when compiled against the ucontext"); +} + +xbt_thread_t xbt_thread_self(void){ + xbt_die("No pthread in SG when compiled against the ucontext"); +} + +void xbt_thread_yield(void){ + xbt_die("No pthread in SG when compiled against the ucontext"); +} + + +xbt_mutex_t xbt_mutex_init(void){ + xbt_die("No pthread in SG when compiled against the ucontext"); +} + +void xbt_mutex_lock(xbt_mutex_t mutex){ + xbt_die("No pthread in SG when compiled against the ucontext"); +} + +void xbt_mutex_unlock(xbt_mutex_t mutex){ + xbt_die("No pthread in SG when compiled against the ucontext"); +} + +void xbt_mutex_destroy(xbt_mutex_t mutex){ + xbt_die("No pthread in SG when compiled against the ucontext"); +} + +xbt_thcond_t xbt_thcond_init(void){ + xbt_die("No pthread in SG when compiled against the ucontext"); +} + +void xbt_thcond_wait(xbt_thcond_t cond, xbt_mutex_t mutex){ + xbt_die("No pthread in SG when compiled against the ucontext"); +} + +void xbt_thcond_signal(xbt_thcond_t cond){ + xbt_die("No pthread in SG when compiled against the ucontext"); +} + +void xbt_thcond_broadcast(xbt_thcond_t cond){ + xbt_die("No pthread in SG when compiled against the ucontext"); +} + +void xbt_thcond_destroy(xbt_thcond_t cond){ + xbt_die("No pthread in SG when compiled against the ucontext"); +} + + +#endif -- 2.20.1