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. 5b1e6b3f79c186b6719c36fc40798ea253b41cc7
Date: Thu, 03 Sep 2009 09:10:46 +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  5b1e6b3f79c186b6719c36fc40798ea253b41cc7 (commit)
      from  230009e41bc8cf94ddde661912077eb56c7b53fb (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=5b1e6b3f79c186b6719c36fc40798ea253b41cc7

commit 5b1e6b3f79c186b6719c36fc40798ea253b41cc7
Author: Klaus Treichel <address@hidden>
Date:   Thu Sep 3 11:10:04 2009 +0200

    Remove obsolete file no_thread.c in support and replace calls to 
ILThreadSelf
    with calls to the internal function _ILThreadGetSelf where possible.

diff --git a/ChangeLog b/ChangeLog
index f8bbc11..8ec5d41 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2009-09-03  Klaus Treichel  <address@hidden>
+
+       * support/no_thread.c: Delete obsolete file
+
+       * support/interrupt_posix.c: Replace calls to ILThreadSelf by calls to
+       _ILThreadGetSelf.
+
+       * support/interrupt_win32.c: likewise
+
+       * support/wait.c: likewise
+
+       * support/wait_mutex.c: likewise
+
 2009-09-02  Klaus Treichel  <address@hidden>
 
        * configure.in: Add configure switch --enable-tls to allow enabling
diff --git a/support/interrupt_posix.c b/support/interrupt_posix.c
index 6554c15..eeb2b65 100755
--- a/support/interrupt_posix.c
+++ b/support/interrupt_posix.c
@@ -81,7 +81,7 @@ static void __sigaction_handler(int signo, siginfo_t *info, 
void *ctx)
        uc = (ucontext_t *)ctx;
 #endif
 
-       thread = ILThreadSelf();
+       thread = _ILThreadGetSelf();
 
 #if defined(IL_INTERRUPT_HAVE_X86_CONTEXT)
 
@@ -125,7 +125,7 @@ static void __sigaction_handler(int signo, siginfo_t *info, 
void *ctx)
                case SIGSEGV:
                case SIGBUS:
 
-                       thread = ILThreadSelf();
+                       thread = _ILThreadGetSelf();
 
                        context.memoryAddress = info->si_addr;
                        context.type = IL_INTERRUPT_TYPE_ILLEGAL_MEMORY_ACCESS;
@@ -172,7 +172,7 @@ static void __signal_handler(int signal)
        ILThread *thread;
        ILInterruptContext context;
 
-       thread = ILThreadSelf();
+       thread = _ILThreadGetSelf();
 
        switch (signal)
        {
diff --git a/support/interrupt_win32.c b/support/interrupt_win32.c
index 2d7d33c..c62eebe 100755
--- a/support/interrupt_win32.c
+++ b/support/interrupt_win32.c
@@ -37,7 +37,7 @@ static LPTOP_LEVEL_EXCEPTION_FILTER __previousFilter;
 
 static LONG CALLBACK __UnhandledExceptionFilter(EXCEPTION_POINTERS* 
ExceptionInfo)
 {
-       ILThread *thread = ILThreadSelf();
+       ILThread *thread = _ILThreadGetSelf();
        ILInterruptContext context;
 
        context.instructionAddress = 
ExceptionInfo->ExceptionRecord->ExceptionAddress;
diff --git a/support/no_thread.c b/support/no_thread.c
deleted file mode 100644
index cdc2a9a..0000000
--- a/support/no_thread.c
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * no_thread.c - Thread management stubs for single-threaded systems.
- *
- * Copyright (C) 2002  Southern Storm Software, Pty Ltd.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include "thr_choose.h"
-
-#ifdef IL_NO_THREADS
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Internal structure of a thread object.
- */
-struct _tagILThread
-{
-       void    *objectArg;
-       int              isBackground;
-};
-
-/*
- * Global data for the stubs.
- */
-static ILThread *globalThread = 0;
-
-int ILHasThreads(void)
-{
-       /* We don't have thread support on this system */
-       return 0;
-}
-
-void ILThreadInit(void)
-{
-       /* Bail out if already initialized */
-       if(globalThread != 0)
-       {
-               return;
-       }
-
-       /* Allocate a block for the single global thread object */
-       globalThread = (ILThread *)ILMalloc(sizeof(ILThread));
-       if(globalThread)
-       {
-               globalThread->objectArg = 0;
-               globalThread->isBackground = 0;
-       }
-}
-
-ILThread *ILThreadCreate(ILThreadStartFunc startFunc, void *objectArg)
-{
-       /* We cannot create new threads with this implementation */
-       return 0;
-}
-
-int ILThreadStart(ILThread *thread)
-{
-       /* We can't actually start other threads, so this will
-          never get called.  If it is, then the thread cannot
-          be started */
-       return 0;
-}
-
-void ILThreadDestroy(ILThread *thread)
-{
-       /* Nothing to do here - there is only one thread in the
-          system and it is the current one which we cannot destroy */
-}
-
-ILThread *ILThreadSelf(void)
-{
-       return globalThread;
-}
-
-void *ILThreadGetObject(ILThread *thread)
-{
-       return thread->objectArg;
-}
-
-void ILThreadSetObject(ILThread *thread, void *objectArg)
-{
-       thread->objectArg = objectArg;
-}
-
-int ILThreadSuspend(ILThread *thread)
-{
-       /* It isn't possible to suspend the only thread in the system */
-       return 0;
-}
-
-void ILThreadResume(ILThread *thread)
-{
-       /* The global thread is always "resumed" */
-}
-
-void ILThreadInterrupt(ILThread *thread)
-{
-       /* Since we cannot get into a wait state, there is no need to interrupt 
*/
-}
-
-int ILThreadGetBackground(ILThread *thread)
-{
-       return thread->isBackground;
-}
-
-void ILThreadSetBackground(ILThread *thread, int flag)
-{
-       thread->isBackground = flag;
-}
-
-int ILThreadGetState(ILThread *thread)
-{
-       /* The global thread is always running */
-       return IL_TS_RUNNING;
-}
-
-void ILThreadAtomicStart(void)
-{
-       /* Nothing to do here */
-}
-
-void ILThreadAtomicEnd(void)
-{
-       /* Nothing to do here */
-}
-
-void ILThreadMemoryBarrier(void)
-{
-       /* Nothing to do here */
-}
-
-void ILThreadGetCounts(unsigned long *numForeground,
-                                          unsigned long *numBackground)
-{
-       *numForeground = (globalThread->isBackground ? 0 : 1);
-       *numBackground = (globalThread->isBackground ? 1 : 0);
-}
-
-ILMutex *ILMutexCreate(void)
-{
-       /* We don't have mutexes, but we need to fool the caller
-          into thinking that we do.  So allocate a dummy block */
-       return (ILMutex *)ILMalloc(sizeof(void *));
-}
-
-void ILMutexDestroy(ILMutex *mutex)
-{
-       ILFree(mutex);
-}
-
-void ILMutexLock(ILMutex *mutex)
-{
-       /* Nothing to do here */
-}
-
-void ILMutexUnlock(ILMutex *mutex)
-{
-       /* Nothing to do here */
-}
-
-ILRWLock *ILRWLockCreate(void)
-{
-       /* We don't have rwlocks, but we need to fool the caller
-          into thinking that we do.  So allocate a dummy block */
-       return (ILRWLock *)ILMalloc(sizeof(void *));
-}
-
-void ILRWLockDestroy(ILRWLock *rwlock)
-{
-       ILFree(rwlock);
-}
-
-void ILRWLockReadLock(ILRWLock *rwlock)
-{
-       /* Nothing to do here */
-}
-
-void ILRWLockWriteLock(ILRWLock *rwlock)
-{
-       /* Nothing to do here */
-}
-
-void ILRWLockUnlock(ILRWLock *rwlock)
-{
-       /* Nothing to do here */
-}
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif /* IL_NO_THREADS */
diff --git a/support/wait.c b/support/wait.c
index cf26406..de54638 100644
--- a/support/wait.c
+++ b/support/wait.c
@@ -143,7 +143,7 @@ static int _ILLeaveWaitHandle(ILThread *thread, 
ILWaitHandle *handle, int ok)
 
 int ILSignalAndWait(ILWaitHandle *signalHandle, ILWaitHandle *waitHandle, 
ILUInt32 timeout)
 {
-       ILThread *thread = ILThreadSelf();
+       ILThread *thread = _ILThreadGetSelf();
        _ILWakeup *wakeup = &(thread->wakeup);
        int result;
 
@@ -208,7 +208,7 @@ int ILSignalAndWait(ILWaitHandle *signalHandle, 
ILWaitHandle *waitHandle, ILUInt
 
 int ILWaitOne(ILWaitHandle *handle, ILUInt32 timeout)
 {
-       ILThread *thread = ILThreadSelf();
+       ILThread *thread = _ILThreadGetSelf();
        _ILWakeup *wakeup = &(thread->wakeup);
        int result;
 
@@ -266,7 +266,7 @@ int ILWaitOne(ILWaitHandle *handle, ILUInt32 timeout)
 
 int ILWaitAny(ILWaitHandle **handles, ILUInt32 numHandles, ILUInt32 timeout)
 {
-       ILThread *thread = ILThreadSelf();
+       ILThread *thread = _ILThreadGetSelf();
        _ILWakeup *wakeup = &(thread->wakeup);
        int result;
        ILUInt32 index, index2;
@@ -358,7 +358,7 @@ int ILWaitAny(ILWaitHandle **handles, ILUInt32 numHandles, 
ILUInt32 timeout)
 
 int ILWaitAll(ILWaitHandle **handles, ILUInt32 numHandles, ILUInt32 timeout)
 {
-       ILThread *thread = ILThreadSelf();
+       ILThread *thread = _ILThreadGetSelf();
        _ILWakeup *wakeup = &(thread->wakeup);
        int result;
        ILUInt32 index, index2;
@@ -466,7 +466,7 @@ int ILWaitAll(ILWaitHandle **handles, ILUInt32 numHandles, 
ILUInt32 timeout)
  */
 int _ILWaitOneBackupInterruptsAndAborts(ILWaitHandle *handle, int timeout)
 {      
-       ILThread *thread = ILThreadSelf();
+       ILThread *thread = _ILThreadGetSelf();
        int result, retval = 0, threadstate = 0;
        
        for (;;)
diff --git a/support/wait_mutex.c b/support/wait_mutex.c
index d08fd98..b3e0984 100644
--- a/support/wait_mutex.c
+++ b/support/wait_mutex.c
@@ -429,7 +429,7 @@ ILWaitHandle *ILWaitMutexCreate(int initiallyOwned)
 
        if(initiallyOwned)
        {
-               mutex->owner = &((ILThreadSelf())->wakeup);
+               mutex->owner = &((_ILThreadGetSelf())->wakeup);
                mutex->count = 1;               
                AddMutexToWakeup(mutex, mutex->owner);
        }
@@ -493,7 +493,7 @@ ILWaitHandle *ILWaitMutexNamedCreate(const char *name, int 
initiallyOwned,
                        if(initiallyOwned)
                        {
                                owned = (ILWaitOne(&(mutex->parent.parent), 0) 
== 0);
-                               AddMutexToWakeup(&(mutex->parent), 
&(ILThreadSelf()->wakeup));
+                               AddMutexToWakeup(&(mutex->parent), 
&(_ILThreadGetSelf()->wakeup));
                        }
                        else
                        {
@@ -535,7 +535,7 @@ ILWaitHandle *ILWaitMutexNamedCreate(const char *name, int 
initiallyOwned,
        mutex->parent.parent.signalFunc = MutexSignal;
        if(initiallyOwned)
        {
-               mutex->parent.owner = &((ILThreadSelf())->wakeup);
+               mutex->parent.owner = &((_ILThreadGetSelf())->wakeup);
                mutex->parent.count = 1;
                AddMutexToWakeup(&(mutex->parent), mutex->parent.owner);
        }
@@ -571,7 +571,7 @@ int ILWaitMutexRelease(ILWaitHandle *handle)
        /* Lock down the mutex */
        _ILMutexLock(&(mutex->parent.lock));
 
-       wakeup = &ILThreadSelf()->wakeup;
+       wakeup = &_ILThreadGetSelf()->wakeup;
 
        /* Determine what to do based on the mutex's state */
        if((mutex->parent.kind & IL_WAIT_MUTEX) == 0)
@@ -684,9 +684,9 @@ ILWaitHandle *ILWaitMonitorCreate(void)
  */
 int ILWaitMonitorWait(ILWaitHandle *handle, ILUInt32 timeout)
 {
-       ILThread *thread = ILThreadSelf();
+       ILThread *thread = _ILThreadGetSelf();
        ILWaitMonitor *monitor = (ILWaitMonitor *)handle;
-       _ILWakeup *wakeup = &((ILThreadSelf())->wakeup);
+       _ILWakeup *wakeup = &(thread->wakeup);
        int result, result2;
        unsigned long saveCount;
 
@@ -794,7 +794,7 @@ int ILWaitMonitorWait(ILWaitHandle *handle, ILUInt32 
timeout)
 static IL_INLINE int PrivateWaitMonitorPulse(ILWaitHandle *handle, int all)
 {
        ILWaitMonitor *monitor = (ILWaitMonitor *)handle;
-       _ILWakeup *wakeup = &((ILThreadSelf())->wakeup);
+       _ILWakeup *wakeup = &((_ILThreadGetSelf())->wakeup);
        int result;
 
        /* Lock down the monitor */

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

Summary of changes:
 ChangeLog                 |   13 +++
 support/interrupt_posix.c |    6 +-
 support/interrupt_win32.c |    2 +-
 support/no_thread.c       |  208 ---------------------------------------------
 support/wait.c            |   10 +-
 support/wait_mutex.c      |   14 ++--
 6 files changed, 29 insertions(+), 224 deletions(-)
 delete mode 100644 support/no_thread.c


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




reply via email to

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