2013-03-12 Andrew John Hughes <gnu.andrew@redhat.com>
* include/posix-threads.h:
(_Jv_MutexCheckMonitor(_Jv_Mutex_t)): Use
pthread_equal rather than !=.
From-SVN: r196639
2009-11-17 Andrew Haley <aph@redhat.com>
* posix-threads.cc (park): Rewrite code to handle time.
Move mutex lock before the call to compare_and_swap to avoid a
race condition.
Add some assertions.
(unpark): Add an assertion.
(init): Move here from posix-threads.h.
* include/posix-threads.h (destroy): removed.
From-SVN: r154265
libjava:
Hashtable synchronization for PowerPC.
* configure.in: Define SLOW_PTHREAD_SELF if configure.host set
slow_pthread_self. Set up symlink for sysdeps directory.
* configure: Rebuild.
* configure.host: Document more shell variables. Set sysdeps_dir
for most platforms. Set slow_pthread_self for i686. Set
enable_hash_synchronization_default and slow_pthread_self for PowerPC.
* posix-threads.cc (_Jv_ThreadSelf_out_of_line): Use release_set so
that memory barrier is emitted where required.
* prims.cc: 64-bit align static primitive class instances.
* include/posix-threads.h (_Jv_ThreadSelf for SLOW_PTHREAD_SELF): Add
read_barrier() to enforce ordering of reads.
* sysdep/powerpc/locks.h: New file. Implementation of synchronization
primitives for PowerPC.
* sysdep/i386/locks.h: New file. Synchronization primitives for i386
moved from natObject.cc.
* sysdep/alpha/locks.h: Likewise.
* sysdep/ia64/locks.h: Likewise.
* sysdep/generic/locks.h: Likewise.
* java/lang/natObject.cc: Move thread synchronization primitives to
system-dependent headers.
gcc/java:
* decl.c (java_init_decl_processing): Make sure class_type_node
alignment is not less than 64 bits if hash synchronization isenabled.
boehm-gc:
* include/gc_priv.h: Define ALIGN_DOUBLE on 32 bit targets if GCJ
support is enabled, for hash synchronization.
From-SVN: r50523
2001-05-18 Alexandre Petit-Bianco <apbianco@redhat.com>
* include/posix-threads.h (_Jv_CondInit): `0' used in place of `NULL.'
(_Jv_MutexInit): Likewise.
(http://gcc.gnu.org/ml/java-patches/2001-q2/msg00245.html )
From-SVN: r42303
* configure.in: Rename THREADLIB to THREADLIBS.
* Makefile.am (LINK): Add $(THREADLIBS) to libtool command line. This
ensures that we link the correct version of the linuxthreads semaphore
functions.
* Makefile.in: Rebuilt.
* configure: Rebuilt.
* linux_thread.c (GC_thr_init, GC_suspend_handler): Add SIGABRT to the
list of signals which are not blocked during suspend in the NO_SIGNALS
case.
For libjava:
* Makefile.am (libgcj_la_LIBADD): Add $(THREADLIBS). This ensures that
the correct versions of various linuxthreads functions get linked.
* Makefile.in: Rebuilt.
* java/lang/natThread.cc (finalize_native): New static function. Call
_Jv_ThreadDestroyData.
(initialize_native): Register finalizer for "data".
* include/posix-threads.h (_Jv_ThreadInitData): New simpler prototype.
(_Jv_ThreadDestroyData): New prototype.
* include/win32-threads.h: Ditto.
* include/no-threads.h: Ditto.
* posix-threads.cc (_Jv_ThreadInitData): Implement new prototype.
(_Jv_ThreadDestroyData): New function. Free native thread "data" and
move mutex and condition variable destroy code from:
(really_start): ...here.
(_Jv_ThreadStart): Set PTHREAD_CREATE_DETACHED.
* win32-threads.cc (_Jv_ThreadInitData): Implement new prototype.
(_Jv_ThreadDestroyData): Implemented.
* nogc.cc (_Jv_AllocObject): Use "void *" not "ptr_t".
(_Jv_AllocArray): Ditto.
From-SVN: r38557
2000-04-08 Anthony Green <green@cygnus.com>
* 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.
From-SVN: r33037
* Makefile.in: New #defines and friends for Thread.h.
* 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.
From-SVN: r32773
* All files: Updated copyright information.
* COPYING: New file.
* COPYING.LIB: Removed.
* LIBGCJ_LICENSE: We now use GPL + special exception.
From-SVN: r32387
1999-09-07 Tom Tromey <tromey@cygnus.com>
* 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.
From-SVN: r29177
* include/posix-threads.h (PTHREAD_MUTEX_IS_STRUCT): New define.
(_Jv_PthreadGetMutex): Use it.
(_Jv_PthreadCheckMonitor): Use new M_COUNT macros.
(_Jv_MutexInit): Use PTHREAD_MUTEX_IS_STRUCT.
(_Jv_MutexLock): Likewise.
(_Jv_MutexUnlock): Likewise.
* include/config.h.in: Rebuilt.
* acconfig.h (PTHREAD_MUTEX_HAVE_M_COUNT,
PTHREAD_MUTEX_HAVE___M_COUNT): New undefs.
* configure: Rebuilt.
* libgcj.spec.in: Don't mention INTERPSPEC.
* configure.in (INTERPSPEC): Removed.
Only run pthreads-related checks when using POSIX threads. Check
for m_count and __m_count in mutex structure.
From-SVN: r29048
* posix-threads.cc (_Jv_CondWait): Use _Jv_PthreadGetMutex.
* 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.
From-SVN: r29032