summaryrefslogtreecommitdiff
path: root/libjava/posix-threads.cc
Commit message (Collapse)AuthorAgeFilesLines
* 2000-04-08 Anthony Green <green@cygnus.com>green2000-04-091-33/+0
| | | | | | | | | | * posix-threads.cc (_Jv_MutexLock): Moved back to posix-threads.h. (_Jv_MutexUnlock): Ditto. * include/posix-threads.h (_Jv_MutexLock): From posix-threads.cc. (_Jv_MutexUnlock): Ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@33037 138bc75d-0d04-0410-961f-82ee72b054a4
* * Makefile.in: New #defines and friends for Thread.h.bryce2000-03-281-167/+207
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * posix-threads.cc: (struct starter): Remove `object'. (_Jv_CondWait): Use interruptable condition variables and new recursive mutexes. New return codes on interrupt or non-ownership of mutex. (_Jv_CondNotify): Ditto. (_Jv_CondNotifyAll): Ditto. (_Jv_ThreadInterrupt): Set thread interrupt flag directly. Interrupt the target thread by signaling its wait condition. (_Jv_ThreadInitData): Set `thread_obj' in the thread data struct, not the starter struct. Initialize wait_mutex and wait_cond. (_Jv_MutexLock): New recursive mutex implementation. Moved from posix-threads.h. (_Jv_MutexUnlock): Ditto. (really_start): Set info->data->thread from pthread_self() to work around a race condition. Destroy wait_mutex and wait_cond when run() returns. * java/lang/Thread.java: (isInterrupted_): Renamed to overloaded `isInterrupted(boolean)'. Clear interrupted flag if clear_flag is set. startable_flag: New private field. (Thread): Initialize `startable_flag'. (toString): Check for null thread group. * java/lang/natThread.cc: (struct natThread): New fields `join_mutex', `join_cond'. Removed fields `joiner', `next'. (class locker): Removed. (initialize_native): Initialize `join_cond' and `join_mutex'. (interrupt): Now just calls _Jv_ThreadInterrupt(). (join): Simplified. Just wait on the target thread's join condition. (finish_): Remove join list code. Unset thread group. Signal potential joiners by notifying the dying threads join_cond. (start): Check for illegal restarts. * java/lang/natObject.cc: Check for return value of _Jv_CondWait and act appropriatly. * include/posix-threads.h: Remove all HAVE_RECURSIVE_MUTEX related #defines and #ifdefs. (struct _Jv_Thread_t): New fields `thread_obj', `wait_cond', `wait_mutex', `next'. (struct _Jv_ConditionVariable_t): Define as a struct instead of directly mapping to pthread_cond_t. (struct _Jv_Mutex_t): New recursive implementation. (_Jv_PthreadCheckMonitor): Reimplemented. Simple `owner' check. _Jv_HaveCondDestroy: Never define this for posix-threads. (_Jv_CondNotify): Remove inline implementation(s), prototype instead. (_Jv_CondNotifyAll): Ditto. (_Jv_MutexLock): Ditto. (_Jv_MutexUnlock): Ditto. (_Jv_MutexInit): Changed to reflect new mutex implementation. (_Jv_MutexDestroy): Ditto. (_Jv_CondDestroy): Removed. (_Jv_PthreadGetMutex): Removed. * include/win32-threads.h: (_Jv_CondNotify): Guess _JV_NOT_OWNER on an error. Add a FIXME about this. (_Jv_CondNotifyAll): Ditto. * win32-threads.cc: (_Jv_CondWait): Return 0 on a timeout. Guess _JV_NOT_OWNER on other errors. Add FIXME. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32773 138bc75d-0d04-0410-961f-82ee72b054a4
* * All files: Updated copyright information.tromey2000-03-071-1/+1
| | | | | | | | | * COPYING: New file. * COPYING.LIB: Removed. * LIBGCJ_LICENSE: We now use GPL + special exception. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32387 138bc75d-0d04-0410-961f-82ee72b054a4
* * All files: Updated copyright to reflect Cygnus purchase.tromey2000-01-191-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@31504 138bc75d-0d04-0410-961f-82ee72b054a4
* 1999-12-22 Bryce McKinlay <bryce@albatross.co.nz>bryce1999-12-241-55/+71
| | | | | | | | | | | | | | | | | | | | | | | | * java/lang/natObject.cc (notify): Throw message with IllegalMonitorStateException. (notifyAll): Ditto. (wait): Ditto. * java/lang/Thread.java (isInterrupted): Don't clear interrupt_flag. (isInterrupted_): New function, which does clear interrupt_flag. (interrupt): Use `isInterrupted_'. * java/lang/natThread.cc (interrupt): Add comment. (join): Set `Prev' in joiner loop. Change various calls to `isInterrupted' to use `isInterrupted_'. * posix-threads.cc (_Jv_CondWait): Allways use pthread_cond_timedwait on linux. Set result to 0 on an interrupt. Test interrupted status of java Thread object directly. FLAG_INTERRUPTED: removed. (_Jv_ThreadStart): Throw OutOfMemoryError if pthread_create fails. (_Jv_ThreadInterrupt): Don't set FLAG_INTERRUPTED. (_Jv_InitThreads): Don't block SIGINT. (_Jv_ThreadWait): Don't configure SIGINT handler. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@31082 138bc75d-0d04-0410-961f-82ee72b054a4
* * posix-threads.cc (_Jv_MutexInit): Use _Jv_PthreadGetMutex to gettromey1999-11-301-1/+4
| | | | | | | | mutex to initialize. Initialize `count' if required. Fixes PR libgcj/98. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30725 138bc75d-0d04-0410-961f-82ee72b054a4
* * include/quick-threads.h (_Jv_ThreadCancel): Removed.tromey1999-11-041-23/+0
| | | | | | | | | | | | | | | | | | | (_Jv_ThreadDestroy): Likewise. * include/no-threads.h (_Jv_ThreadCancel): Removed. (_Jv_ThreadDestroy): Likewise. * include/posix-threads.h (struct _Jv_Thread_t): Removed `exception' field. (_Jv_ThreadCancel): Removed decl. (_Jv_ThreadDestroy): Removed. * posix-threads.cc (_Jv_ThreadCancel): Removed. (throw_cleanup): Removed. (really_start): Don't push or pop cleanup. (_Jv_ThreadInitData): Don't initialize `exception' field. * java/lang/Thread.java (stop): Officially unimplemented. * java/lang/natThread.cc (stop): Officially unimplemented. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30392 138bc75d-0d04-0410-961f-82ee72b054a4
* 1999-11-02 Bryce McKinlay <bryce@albatross.co.nz>bryce1999-11-031-0/+1
| | | | | | | | * posix-threads.cc: Don't include boehm-config.h. Include gcconfig.h instead. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30365 138bc75d-0d04-0410-961f-82ee72b054a4
* 1999-11-02 Bryce McKinlay <bryce@albatross.co.nz>bryce1999-11-031-1/+0
| | | | | | | * posix-threads.cc: Don't include boehm-config.h. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30361 138bc75d-0d04-0410-961f-82ee72b054a4
* * configure: Rebuilt.tromey1999-09-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.in: Build include/Makefile. * Makefile.in: Rebuilt. * Makefile.am (SUBDIRS): Added gcj and include. (install-data-local): New target. (extra_headers): New macro. * include/Makefile.in: New file. * include/Makefile.am: New file. * interpret.cc: Don't include gcj/field.h or gcj/cni.h. * java/lang/reflect/natField.cc: Don't include gcj/field.h or gcj/cni.h. * boehm.cc: Don't include java-threads.h or gcj/field.h. * resolve.cc: Include config.h. * defineclass.cc: Include config.h. * include/java-interp.h: Don't include config.h. * include/jvm.h: Include java-threads.h, Object.h, java-gc.h, cni.h. * gcj/javaprims.h: Regenerated namespace decls. * classes.pl (scan): Don't put `;' after closing brace. * Makefile.in: Rebuilt. * Makefile.am (INCLUDES): Added -I for top_srcdir. * configure.in: Create gcj/Makefile. * gcj/Makefile.in: New file. * gcj/Makefile.am: New file. * java/lang/Object.h: Don't include any other headers. * gcj/array.h: Renamed from include/java-array.h. * gcj/field.h: Renamed from include/java-field.h. * gcj/method.h: Renamed from include/java-method.h. * gcj/cni.h, gcj/javaprims.h: Moved from include/. Updated all files to reflect new include structure. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29278 138bc75d-0d04-0410-961f-82ee72b054a4
* * posix-threads.cc (_Jv_CondWait): pthread_ calls return errortromey1999-09-081-3/+3
| | | | | | | code and don't set errno. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29179 138bc75d-0d04-0410-961f-82ee72b054a4
* 1999-09-07 Tom Tromey <tromey@cygnus.com>tromey1999-09-081-9/+55
| | | | | | | | | | | | | | | | | | * posix-threads.cc (_Jv_CondWait): Check `errno' against EINTR, not `r'. Changed `done_sleeping' to a `bool'. 1999-09-07 Matt Welsh <mdw@cs.berkeley.edu * libjava/posix-threads.cc: Added _Jv_ThreadDataKey. Added FLAG_INTERRUPTED to indicate that a thread was interrupted by another thread, rather than by the GC. (_Jv_CondWait): Prevent premature thread wakeup by GC. (_Jv_InitThreads): Initialize _Jv_ThreadDataKey. * libjava/include/posix-threads.h (_Jv_ThreadCurrentData): New function. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29177 138bc75d-0d04-0410-961f-82ee72b054a4
* * posix-threads.cc (_Jv_CondWait): Use _Jv_PthreadGetMutex.tromey1999-09-011-6/+1
| | | | | | | | | | | | | | | * include/posix-threads.h (_Jv_Mutex_t): Define as structure, except on Linux. (_Jv_PthreadGetMutex): New function. (_Jv_PthreadCheckMonitor): Use it. (_Jv_MutexInit): Likewise. ALso, initialize `count'. (_Jv_MutexLock): Update `count'. (_Jv_MutexUnlock): Likewise. (_Jv_PthreadCheckMonitor): Use Linux-specific knowledge when appropriate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29032 138bc75d-0d04-0410-961f-82ee72b054a4
* * posix-threads.cc (_Jv_CondWait): Call _Jv_PthreadCheckMonitor.tromey1999-09-011-0/+5
| | | | | | | | | | | | * include/posix-threads.h (_Jv_PthreadCheckMonitor): New function. (_Jv_CondNotify): Use it. (_Jv_CondNotifyAll): Likewise. * java/lang/Class.h (JV_STATE_NOTHING): Correct misspelling. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29030 138bc75d-0d04-0410-961f-82ee72b054a4
* * posix-threads.cc: Include <errno.h>.bryce1999-08-251-0/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@28831 138bc75d-0d04-0410-961f-82ee72b054a4
* * boehm.cc: Undefine TRUE and FALSE.tromey1999-08-241-1/+1
| | | | | | | * posix-threads.cc (_Jv_CondWait): Use ETIMEDOUT, not ETIME. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@28810 138bc75d-0d04-0410-961f-82ee72b054a4
* * posix-threads.cc (_Jv_CondWait): Treat a timeout as a normaltromey1999-08-221-0/+3
| | | | | | | result. PR 40. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@28799 138bc75d-0d04-0410-961f-82ee72b054a4
* * posix-threads.cc (_Jv_CondWait): Fix currentTimeMillis() overflow.bryce1999-06-141-6/+5
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@27524 138bc75d-0d04-0410-961f-82ee72b054a4
* Initial revisiontromey1999-04-071-0/+360
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@26263 138bc75d-0d04-0410-961f-82ee72b054a4