[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[dotgnu-pnet-commits] [SCM] DotGNU Portable.NET engine, compilers and to
From: |
Klaus Treichel |
Subject: |
[dotgnu-pnet-commits] [SCM] DotGNU Portable.NET engine, compilers and tools (pnet) branch, master, updated. beaedd86ea15acd63d12a7963d22fc9a61d9102e |
Date: |
Fri, 11 Sep 2009 07:05:01 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "DotGNU Portable.NET engine, compilers and tools (pnet)".
The branch, master has been updated
via beaedd86ea15acd63d12a7963d22fc9a61d9102e (commit)
from a5d1ee0b502958f2f433a3b74ba3bd8f2d8d0538 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/pnet.git/commit/?id=beaedd86ea15acd63d12a7963d22fc9a61d9102e
commit beaedd86ea15acd63d12a7963d22fc9a61d9102e
Author: Klaus Treichel <address@hidden>
Date: Fri Sep 11 09:03:45 2009 +0200
Replace code sequences like ILThreadAtomicStart(); ...
ILThreadAtomicEnd(); by calls to the corresponding interlocked
functions where possible.
diff --git a/ChangeLog b/ChangeLog
index 3f1f1ec..91bb1b0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2009-09-11 Klaus Treichel <address@hidden>
+
+ * engine/cvm_call.c (CHECK_MANAGED_BARRIER): Clear the thread's flags
+ by using the new interlocked functions now.
+ (VMCASE(COP_PREFIX_PROFILE_COUNT)): Fix a compiler warning by adding
+ a cast to ILInt32 * for the pointer to the method call counter.
+
+ * engine/engine.h: Change the member mabagedSafepointFlags to ILUInt32
+ to be able to use interlocked functions.
+
+ * engine/jitc.c (ILRuntimeHandleManagedSafePointFlags): Clear the
+ thread's _IL_MANAGED_SAFEPOINT_THREAD_SUSPEND flag by using the new
+ interlocked functions now.
+
+ * engine/lib_thread.c (_IL_Thread_ResetAbort): Clear the thread's
+ _IL_MANAGED_SAFEPOINT_THREAD_ABORT flag by using the new interlocked
+ functions now.
+
+ * engine/thread.c (_ILExecThreadSelfAborting, _ILExecThreadResumeThread,
+ _ILExecThreadSuspendThread, _ILExecThreadAbortThread): Set and clear
+ the managedSafepointFlags by using the new interlocked functions now.
+
2009-09-10 Klaus Treichel <address@hidden>
Change internal organization of the interlocked functions.
diff --git a/engine/cvm_call.c b/engine/cvm_call.c
index c79077b..9e76b83 100644
--- a/engine/cvm_call.c
+++ b/engine/cvm_call.c
@@ -103,9 +103,8 @@ ILCallFrame *_ILAllocCallFrame(ILExecThread *thread)
{ \
if (_ILExecThreadSelfAborting(thread) == 0) \
{ \
- ILThreadAtomicStart(); \
- thread->managedSafePointFlags &=
~_IL_MANAGED_SAFEPOINT_THREAD_ABORT; \
- ILThreadAtomicEnd(); \
+
ILInterlockedAnd(&(thread->managedSafePointFlags), \
+
~_IL_MANAGED_SAFEPOINT_THREAD_ABORT); \
stacktop[0].ptrValue = thread->thrownException;
\
thread->thrownException = 0; \
stacktop += 1; \
@@ -114,9 +113,8 @@ ILCallFrame *_ILAllocCallFrame(ILExecThread *thread)
} \
else if (thread->managedSafePointFlags &
_IL_MANAGED_SAFEPOINT_THREAD_SUSPEND) \
{ \
- ILThreadAtomicStart(); \
- thread->managedSafePointFlags &=
~_IL_MANAGED_SAFEPOINT_THREAD_SUSPEND; \
- ILThreadAtomicEnd(); \
+ ILInterlockedAnd(&(thread->managedSafePointFlags), \
+
~_IL_MANAGED_SAFEPOINT_THREAD_SUSPEND); \
if (ILThreadGetState(thread->supportThread) &
IL_TS_SUSPEND_REQUESTED) \
{ \
_ILExecThreadSuspendThread(thread,
thread->supportThread); \
@@ -2124,7 +2122,7 @@ VMBREAK(COP_PREFIX_PACK_VARARGS);
VMCASE(COP_PREFIX_PROFILE_COUNT):
{
BEGIN_NATIVE_CALL();
- ILInterlockedIncrement(&method->count);
+ ILInterlockedIncrement((ILInt32 *)(&method->count));
END_NATIVE_CALL();
MODIFY_PC_AND_STACK(CVMP_LEN_NONE,0);
}
diff --git a/engine/engine.h b/engine/engine.h
index 284eb0e..069dec4 100644
--- a/engine/engine.h
+++ b/engine/engine.h
@@ -435,7 +435,7 @@ struct _tagILExecThread
/* Flag of tasks that need to be performed at safe points in
managed code */
- volatile int managedSafePointFlags;
+ volatile ILUInt32 managedSafePointFlags;
/* System.Threading.Thread object */
ILObject *clrThread;
diff --git a/engine/jitc.c b/engine/jitc.c
index 5890523..53e5509 100755
--- a/engine/jitc.c
+++ b/engine/jitc.c
@@ -1646,9 +1646,8 @@ void ILRuntimeHandleManagedSafePointFlags(ILExecThread
*thread)
}
else if(thread->managedSafePointFlags &
_IL_MANAGED_SAFEPOINT_THREAD_SUSPEND)
{
- ILThreadAtomicStart();
- thread->managedSafePointFlags &=
~_IL_MANAGED_SAFEPOINT_THREAD_SUSPEND;
- ILThreadAtomicEnd();
+ ILInterlockedAnd(&(thread->managedSafePointFlags),
+
~_IL_MANAGED_SAFEPOINT_THREAD_SUSPEND);
if(ILThreadGetState(thread->supportThread) &
IL_TS_SUSPEND_REQUESTED)
{
_ILExecThreadSuspendThread(thread,
thread->supportThread);
diff --git a/engine/lib_thread.c b/engine/lib_thread.c
index e61522d..c1eba0a 100644
--- a/engine/lib_thread.c
+++ b/engine/lib_thread.c
@@ -22,7 +22,7 @@
#include "engine.h"
#include "lib_defs.h"
-#include "../support/interlocked.h"
+#include "interlocked.h"
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
@@ -452,10 +452,8 @@ void _IL_Thread_ResetAbort(ILExecThread *thread)
if (ILThreadAbortReset())
{
- ILThreadAtomicStart();
- thread->managedSafePointFlags &=
~_IL_MANAGED_SAFEPOINT_THREAD_ABORT;
- ILThreadAtomicEnd();
-
+ ILInterlockedAnd(&(thread->managedSafePointFlags),
+
~_IL_MANAGED_SAFEPOINT_THREAD_ABORT);
thread->aborting = 0;
#ifdef IL_USE_CVM
thread->abortHandlerEndPC = 0;
diff --git a/engine/thread.c b/engine/thread.c
index 8fe8bfd..753271d 100644
--- a/engine/thread.c
+++ b/engine/thread.c
@@ -23,6 +23,7 @@
#include "engine_private.h"
#include "lib_defs.h"
#include "interrupt.h"
+#include "interlocked.h"
#ifdef __cplusplus
extern "C" {
@@ -310,11 +311,9 @@ int _ILExecThreadSelfAborting(ILExecThread *thread)
/* Allocate an instance of "ThreadAbortException" and
throw */
exception =
_ILExecThreadNewThreadAbortException(thread, 0);
-
- ILThreadAtomicStart();
- thread->managedSafePointFlags &=
~_IL_MANAGED_SAFEPOINT_THREAD_ABORT;
- ILThreadAtomicEnd();
+ ILInterlockedAnd(&(thread->managedSafePointFlags),
+
~_IL_MANAGED_SAFEPOINT_THREAD_ABORT);
thread->aborting = 1;
thread->threadAbortException = 0;
#ifdef IL_USE_CVM
@@ -364,9 +363,8 @@ void _ILExecThreadResumeThread(ILExecThread *thread,
ILThread *supportThread)
}
/* Remove the _IL_MANAGED_SAFEPOINT_THREAD_SUSPEND flag */
- ILThreadAtomicStart();
- execThread->managedSafePointFlags &=
~_IL_MANAGED_SAFEPOINT_THREAD_SUSPEND;
- ILThreadAtomicEnd();
+ ILInterlockedAnd(&(execThread->managedSafePointFlags),
+ ~_IL_MANAGED_SAFEPOINT_THREAD_SUSPEND);
/* Call the threading subsystem's resume */
ILThreadResume(supportThread);
@@ -453,9 +451,8 @@ void _ILExecThreadSuspendThread(ILExecThread *thread,
ILThread *supportThread)
flags, the engine needs to check the ThreadState after
checking the safepoint
flags (see cvm_call.c) */
- ILThreadAtomicStart();
- execThread->managedSafePointFlags |=
_IL_MANAGED_SAFEPOINT_THREAD_SUSPEND;
- ILThreadAtomicEnd();
+ ILInterlockedOr(&(execThread->managedSafePointFlags),
+
_IL_MANAGED_SAFEPOINT_THREAD_SUSPEND);
ILWaitMonitorLeave(monitor);
@@ -499,9 +496,8 @@ void _ILExecThreadAbortThread(ILExecThread *thread,
ILThread *supportThread)
{
/* Mark the flag so the thread self aborts when it next returns
to managed code */
- ILThreadAtomicStart();
- execThread->managedSafePointFlags |=
_IL_MANAGED_SAFEPOINT_THREAD_ABORT;
- ILThreadAtomicEnd();
+ ILInterlockedOr(&(execThread->managedSafePointFlags),
+
_IL_MANAGED_SAFEPOINT_THREAD_ABORT);
}
ILWaitMonitorLeave(monitor);
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 22 ++++++++++++++++++++++
engine/cvm_call.c | 12 +++++-------
engine/engine.h | 2 +-
engine/jitc.c | 5 ++---
engine/lib_thread.c | 8 +++-----
engine/thread.c | 22 +++++++++-------------
6 files changed, 42 insertions(+), 29 deletions(-)
hooks/post-receive
--
DotGNU Portable.NET engine, compilers and tools (pnet)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [dotgnu-pnet-commits] [SCM] DotGNU Portable.NET engine, compilers and tools (pnet) branch, master, updated. beaedd86ea15acd63d12a7963d22fc9a61d9102e,
Klaus Treichel <=
- Prev by Date:
[dotgnu-pnet-commits] [SCM] DotGNU Portable.NET engine, compilers and tools (pnet) branch, master, updated. a5d1ee0b502958f2f433a3b74ba3bd8f2d8d0538
- Next by Date:
[dotgnu-pnet-commits] [SCM] DotGNU Portable.NET engine, compilers and tools (pnet) branch, master, updated. 1dd06b76e354c5c90c6ee590c48f218fea016e8e
- Previous by thread:
[dotgnu-pnet-commits] [SCM] DotGNU Portable.NET engine, compilers and tools (pnet) branch, master, updated. a5d1ee0b502958f2f433a3b74ba3bd8f2d8d0538
- Next by thread:
[dotgnu-pnet-commits] [SCM] DotGNU Portable.NET engine, compilers and tools (pnet) branch, master, updated. 1dd06b76e354c5c90c6ee590c48f218fea016e8e
- Index(es):