/usr/include/scilab/Thread_Wrapper.h is in scilab-include 6.0.1-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | /*
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
* Copyright (C) 2008-2008 - INRIA - Bruno JOFRET
* Copyright (C) 2008-2008 - INRIA - Allan CORNET
* Copyright (C) 2011-2011 - DIGITEO - Bruno JOFRET
*
* Copyright (C) 2012 - 2016 - Scilab Enterprises
*
* This file is hereby licensed under the terms of the GNU GPL v2.0,
* pursuant to article 5.3.4 of the CeCILL v.2.1.
* This file was originally licensed under the terms of the CeCILL v2.1,
* and continues to be available under such terms.
* For more information, see the COPYING file which you should have received
* along with this program.
*
*/
/*
** Thread wrapper to have an easy way to manage
** those features on each platform
*/
#ifndef __THREAD_WRAPPER_H__
#define __THREAD_WRAPPER_H__
#include "dynlib_threads.h"
/*
** WINDOWS
*/
#ifdef _MSC_VER
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x500
#endif
#define NOMINMAX
#include <windows.h>
#undef NOMINMAX
typedef DWORD __threadKey;
typedef HANDLE __threadId;
typedef HANDLE __threadLock;
typedef CRITICAL_SECTION __threadSignalLock;
typedef HANDLE __threadSignal;
#define __StaticInitLock NULL
#define __StaticInitThreadSignal NULL
#else
/*
** LINUX & Mac
*/
#include <pthread.h>
#include <signal.h>
#include <stdlib.h> // malloc
typedef pthread_t __threadKey;
typedef pthread_t __threadId;
typedef pthread_mutex_t __threadLock;
typedef pthread_mutex_t __threadSignalLock;
typedef pthread_cond_t __threadSignal;
#define __StaticInitLock PTHREAD_MUTEX_INITIALIZER
#define __StaticInitThreadSignal PTHREAD_COND_INITIALIZER
#endif
THREADS_IMPEXP void __InitLock(__threadLock *lockName);
THREADS_IMPEXP void __Lock(__threadLock *lockName);
THREADS_IMPEXP void __UnLock(__threadLock *lockName);
THREADS_IMPEXP void __InitSignalLock(__threadSignalLock *lockName);
THREADS_IMPEXP void __LockSignal(__threadSignalLock *lockName);
THREADS_IMPEXP void __UnLockSignal(__threadSignalLock *lockName);
THREADS_IMPEXP void __InitSignal(__threadSignal *signalName);
THREADS_IMPEXP void __Signal(__threadSignal *signalName);
THREADS_IMPEXP void __Wait(__threadSignal *signalName, __threadSignalLock *lockName);
THREADS_IMPEXP void __CreateThread(__threadId *threadId, __threadKey *threadKey, void * (*functionName) (void *));
THREADS_IMPEXP void __CreateThreadWithParams(__threadId *threadId, __threadKey *threadKey, void * (*functionName) (void *), void *params);
THREADS_IMPEXP void __WaitThreadDie(__threadId threadId);
THREADS_IMPEXP void __Terminate(__threadId threadId);
THREADS_IMPEXP __threadId __GetCurrentThreadId();
THREADS_IMPEXP __threadKey __GetCurrentThreadKey();
THREADS_IMPEXP void __SuspendThread(__threadId ThreadId);
THREADS_IMPEXP void __ResumeThread(__threadId ThreadId);
#endif /* !__THREAD_WRAPPER_H__ */
|