dotgnu-pnet-commits
[Top][All Lists]
Advanced

[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. 7a9b3617fc4619e1c4eda8b7af635bee8c419f6a
Date: Thu, 11 Feb 2010 20:08:11 +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  7a9b3617fc4619e1c4eda8b7af635bee8c419f6a (commit)
      from  401a8d92ac96fd7b038f817b31e7c9f88607763b (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=7a9b3617fc4619e1c4eda8b7af635bee8c419f6a

commit 7a9b3617fc4619e1c4eda8b7af635bee8c419f6a
Author: Klaus Treichel <address@hidden>
Date:   Thu Feb 11 21:07:47 2010 +0100

    Use one static signal mask for unblocking the interrupt signal instead
    of creating a new one every time in the INTERRUPTIBLE macros.

diff --git a/ChangeLog b/ChangeLog
index 7d9eb15..cdec80b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-02-11  Klaus Treichel  <address@hidden>
+
+       * support/pt_defs.c (_ILThreadInitSystem): Initialize a static signal
+       mask for interrupting waiting threads.
+       Use the static signal mask in the *INTERRUPTIBLE macros.
+
 2010-02-07  Klaus Treichel  <address@hidden>
 
        * support/interlocked.c: Move the previously inlined backup functions
diff --git a/support/pt_defs.c b/support/pt_defs.c
index ce2d4fc..a6ccf58 100755
--- a/support/pt_defs.c
+++ b/support/pt_defs.c
@@ -43,6 +43,12 @@ extern       "C" {
 #endif
 
 /*
+ * Signal mask that has to be unblocked if thread interrupts have to be
+ * enabled.
+ */
+static sigset_t                _interruptSet;
+
+/*
  * Choose the version to use for modifying the counter in a count semaphore
  */
 #define _SemAdd(dest, value)           ILInterlockedAddI4_Acquire((dest), 
(value))
@@ -84,11 +90,8 @@ extern       "C" {
                        } \
                        else \
                        { \
-                               sigset_t __newset; \
                                sigset_t __oldset; \
-                               sigemptyset(&__newset); \
-                               sigaddset(&__newset, IL_SIG_INTERRUPT); \
-                               pthread_sigmask(SIG_UNBLOCK, &__newset, 
&__oldset); \
+                               pthread_sigmask(SIG_UNBLOCK, &_interruptSet, 
&__oldset); \
                                {
 
 #define IL_END_INTERRUPTIBLE(__result) \
@@ -105,15 +108,12 @@ extern    "C" {
                { \
                        ILThread *__myThread; \
                        ILUInt16 __threadState; \
-                       sigset_t __newset; \
                        sigset_t __oldset; \
                        __myThread = _ILThreadSelf(); \
                        __threadState = 
ILInterlockedLoadU2(&(__myThread->state.split.priv)); \
                        __threadState |= IL_TS_UNINTERRUPTIBLE; \
                        ILInterlockedStoreU2(&(__myThread->state.split.priv), 
__threadState); \
-                       sigemptyset(&__newset); \
-                       sigaddset(&__newset, IL_SIG_INTERRUPT); \
-                       pthread_sigmask(SIG_UNBLOCK, &__newset, &__oldset); \
+                       pthread_sigmask(SIG_UNBLOCK, &_interruptSet, 
&__oldset); \
                        { 
 
 #define IL_END_UNINTERRUPTIBLE(__result) \
@@ -132,14 +132,11 @@ extern    "C" {
 
 #define IL_START_INTERRUPTIBLE(__result) \
                { \
-                       sigset_t __newset; \
                        sigset_t __oldset; \
                        ILThread *__myThread; \
                        ILUInt16 __threadState; \
                        __myThread = _ILThreadSelf(); \
-                       sigemptyset(&__newset); \
-                       sigaddset(&__newset, IL_SIG_INTERRUPT); \
-                       pthread_sigmask(SIG_UNBLOCK, &__newset, &__oldset); \
+                       pthread_sigmask(SIG_UNBLOCK, &_interruptSet, 
&__oldset); \
                        __threadState = 
ILInterlockedLoadU2(&(__myThread->state.split.priv)); \
                        if((__threadState & IL_TS_INTERRUPTED) != 0) \
                        { \
@@ -166,14 +163,11 @@ extern    "C" {
  */
 #define IL_START_UNINTERRUPTIBLE() \
                { \
-                       sigset_t __newset; \
                        sigset_t __oldset; \
                        ILThread *__myThread; \
                        ILUInt16 __threadState; \
                        __myThread = _ILThreadSelf(); \
-                       sigemptyset(&__newset); \
-                       sigaddset(&__newset, IL_SIG_INTERRUPT); \
-                       pthread_sigmask(SIG_UNBLOCK, &__newset, &__oldset); \
+                       pthread_sigmask(SIG_UNBLOCK, &_interruptSet, 
&__oldset); \
                        { 
 
 #define IL_END_UNINTERRUPTIBLE(__result) \
@@ -979,6 +973,12 @@ void _ILThreadInitSystem(ILThread *mainThread)
        action.sa_handler = ResumeSignal;
        sigaction(IL_SIG_RESUME, &action, (struct sigaction *)0);
 
+       /*
+        * Initialize the signal mask for interrupting waits.
+        */
+       sigemptyset(&_interruptSet);
+       sigaddset(&_interruptSet, IL_SIG_INTERRUPT);
+
 #if !defined(USE_COMPILER_TLS)
        /* We need a thread-specific key for storing thread objects */
        pthread_key_create(&_ILThreadObjectKey, (void (*)(void *))0);

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog         |    6 ++++++
 support/pt_defs.c |   32 ++++++++++++++++----------------
 2 files changed, 22 insertions(+), 16 deletions(-)


hooks/post-receive
-- 
DotGNU Portable.NET engine, compilers and tools (pnet)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]