Check if objc_thread_add in runtime

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@9320 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fedor 2001-03-10 21:36:03 +00:00
parent 698493ef14
commit 92f9b03239
5 changed files with 183 additions and 173 deletions

View file

@ -1,3 +1,9 @@
2001-03-10 Adam Fedor <fedor@gnu.org>
* configure.in: Check for objc_thread_add in runtime.
* Source/NSThread.m (objc_thread_add): Define only if not in runtime
(objc_thread_remove): Likewise.
2001-03-10 Manuel Guesdon <mguesdon@orange-concept.com> 2001-03-10 Manuel Guesdon <mguesdon@orange-concept.com>
* GSXML.m/.h: added errer, warning and fatal error methods with * GSXML.m/.h: added errer, warning and fatal error methods with

View file

@ -102,6 +102,9 @@
/* Define if you have the objc_condition_timedwait function. */ /* Define if you have the objc_condition_timedwait function. */
#undef HAVE_OBJC_CONDITION_TIMEDWAIT #undef HAVE_OBJC_CONDITION_TIMEDWAIT
/* Define if you have the objc_thread_add function. */
#undef HAVE_OBJC_THREAD_ADD
/* Define if you have the readlink function. */ /* Define if you have the readlink function. */
#undef HAVE_READLINK #undef HAVE_READLINK

View file

@ -36,15 +36,13 @@
#include <Foundation/NSNotificationQueue.h> #include <Foundation/NSNotificationQueue.h>
#ifndef NO_GNUSTEP #ifndef NO_GNUSTEP
#ifndef HAVE_OBJC_THREAD_ADD
/* We need to access these private vars in the objc runtime - because /* We need to access these private vars in the objc runtime - because
the objc runtime's API is not enough powerful for the GNUstep the objc runtime's API is not enough powerful for the GNUstep
extensions we want to add. */ extensions we want to add. */
#include <objc/runtime.h>
extern int __objc_is_multi_threaded; extern int __objc_is_multi_threaded;
extern objc_mutex_t __objc_runtime_mutex;
extern int __objc_runtime_threads_alive;
/* TODO: Submit patches to the objc runtime to add the following
two functions */
inline static void objc_thread_add () inline static void objc_thread_add ()
{ {
objc_mutex_lock(__objc_runtime_mutex); objc_mutex_lock(__objc_runtime_mutex);
@ -59,6 +57,7 @@ inline static void objc_thread_remove ()
__objc_runtime_threads_alive--; __objc_runtime_threads_alive--;
objc_mutex_unlock(__objc_runtime_mutex); objc_mutex_unlock(__objc_runtime_mutex);
} }
#endif /* not HAVE_OBJC_THREAD_ADD */
#endif #endif
@interface NSThread (Private) @interface NSThread (Private)

337
configure vendored

File diff suppressed because it is too large Load diff

View file

@ -456,8 +456,9 @@ CPPFLAGS="$saved_CPPFLAGS"
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# This function needed by NSLock.m for conditioned wait # This function needed by NSLock.m for conditioned wait
# get_uninstalled_dtable used by behavior.m and objc-load.m # get_uninstalled_dtable used by behavior.m and objc-load.m
# Thread functions used by NSThread
#-------------------------------------------------------------------- #--------------------------------------------------------------------
AC_CHECK_FUNCS(objc_condition_timedwait) AC_CHECK_FUNCS(objc_condition_timedwait objc_thread_add)
AC_EGREP_HEADER(objc_get_uninstalled_dtable, objc/objc-api.h, AC_EGREP_HEADER(objc_get_uninstalled_dtable, objc/objc-api.h,
AC_DEFINE(HAVE_OBJC_GET_UNINSTALLED_DTABLE),) AC_DEFINE(HAVE_OBJC_GET_UNINSTALLED_DTABLE),)