[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: pnet/engine lib_thread.c,1.16,1.17
From: |
Thong Nguyen <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: pnet/engine lib_thread.c,1.16,1.17 |
Date: |
Sun, 06 Jul 2003 05:19:38 -0400 |
Update of /cvsroot/dotgnu-pnet/pnet/engine
In directory subversions:/tmp/cvs-serv16964/engine
Modified Files:
lib_thread.c
Log Message:
Fix GC thread creation and engine monitor-locking bugs under linux.
Index: lib_thread.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/lib_thread.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -r1.16 -r1.17
*** lib_thread.c 6 Jul 2003 00:41:16 -0000 1.16
--- lib_thread.c 6 Jul 2003 09:19:36 -0000 1.17
***************
*** 67,71 ****
* Spins until the object is unmarked and the current thread can mark it.
*/
! static void _IL_ObjectLockword_WaitAndMark(ILExecThread *thread, ILObject
*obj)
{
ILLockWord lockword;
--- 67,71 ----
* Spins until the object is unmarked and the current thread can mark it.
*/
! static void _IL_ObjectLockword_WaitAndMark(ILExecThread *thread, volatile
ILObject *obj)
{
ILLockWord lockword;
***************
*** 86,90 ****
* Unmarks an object's lockword.
*/
! static void _IL_ObjectLockword_Unmark(ILExecThread *thread, ILObject *obj)
{
ILLockWord lockword;
--- 86,90 ----
* Unmarks an object's lockword.
*/
! static void _IL_ObjectLockword_Unmark(ILExecThread *thread, volatile ILObject
*obj)
{
ILLockWord lockword;
***************
*** 99,103 ****
* zeros
*/
! static int _IL_Monitor_CheckAndReturnMonitorToFreeList(ILExecThread *thread,
ILExecMonitor *monitor, ILObject *obj)
{
if (monitor->waiters == 0 &&
ILWaitMonitorCanClose(monitor->supportMonitor))
--- 99,103 ----
* zeros
*/
! static int _IL_Monitor_CheckAndReturnMonitorToFreeList(ILExecThread *thread,
ILExecMonitor *monitor, volatile ILObject *obj)
{
if (monitor->waiters == 0 &&
ILWaitMonitorCanClose(monitor->supportMonitor))
***************
*** 121,129 ****
*/
ILBool _IL_Monitor_InternalTryEnter(ILExecThread *thread,
! ILObject *obj,
ILInt32 timeout)
{
int result;
ILLockWord lockword;
ILExecMonitor *monitor, *next;
/* Make sure the object isn't null */
--- 121,132 ----
*/
ILBool _IL_Monitor_InternalTryEnter(ILExecThread *thread,
! ILObject *objnv, ILInt32 timeout)
{
int result;
ILLockWord lockword;
ILExecMonitor *monitor, *next;
+ volatile ILObject *obj;
+
+ obj = objnv;
/* Make sure the object isn't null */
***************
*** 214,222 ****
_IL_Interlocked_Increment_Ri(thread, (ILInt32 *)&monitor->waiters);
! /* Now double check and see if another thread is trying to exit the
now that monitor->waiters has been incremented monitor */
lockword = GetObjectLockWord(thread, obj);
! if (IL_LW_MARKED(lockword))
{
/* Mark the object's lockword */
--- 217,227 ----
_IL_Interlocked_Increment_Ri(thread, (ILInt32 *)&monitor->waiters);
! /* Now double check and see if another thread is trying to exit
now that monitor->waiters has been incremented monitor */
lockword = GetObjectLockWord(thread, obj);
! if (IL_LW_MARKED(lockword)
! /* This doubles as a check for lockword == 0 */
! || IL_LW_UNMARK(lockword) != monitor)
{
/* Mark the object's lockword */
***************
*** 266,273 ****
* public static void Exit(Object obj);
*/
! void _IL_Monitor_Exit(ILExecThread *thread, ILObject *obj)
{
ILLockWord lockword;
ILExecMonitor *monitor;
/* Make sure obj isn't null */
--- 271,281 ----
* public static void Exit(Object obj);
*/
! void _IL_Monitor_Exit(ILExecThread *thread, ILObject *objnv)
{
ILLockWord lockword;
ILExecMonitor *monitor;
+ volatile ILObject *obj;
+
+ obj = objnv;
/* Make sure obj isn't null */
***************
*** 337,345 ****
*/
ILBool _IL_Monitor_InternalWait(ILExecThread *thread,
! ILObject *obj,
ILInt32 timeout)
{
int result;
ILLockWord lockword;
ILExecMonitor *monitor;
/* Make sure obj isn't null */
--- 345,356 ----
*/
ILBool _IL_Monitor_InternalWait(ILExecThread *thread,
! ILObject *objnv, ILInt32 timeout)
{
int result;
ILLockWord lockword;
ILExecMonitor *monitor;
+ volatile ILObject *obj;
+
+ obj = objnv;
/* Make sure obj isn't null */
***************
*** 385,389 ****
lockword = GetObjectLockWord(thread, obj);
! if (IL_LW_MARKED(lockword))
{
/*
--- 396,402 ----
lockword = GetObjectLockWord(thread, obj);
! if (IL_LW_MARKED(lockword)
! /* This doubles as a check for lockword == 0 */
! || IL_LW_UNMARK(lockword) != monitor)
{
/*
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: pnet/engine lib_thread.c,1.16,1.17,
Thong Nguyen <address@hidden> <=