mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-25 05:20:34 +05:00
* Added a new Compiler Switch (MSVC_EXPRESS) to enable Netgen to be compiled using the Express Editions of Microsoft Visual C++
This commit is contained in:
parent
64ae03d661
commit
34bfd4a349
@ -28,6 +28,61 @@ public:
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
||||
#ifdef MSVC_EXPRESS
|
||||
// #include <pthread.h>
|
||||
|
||||
class NgMutex
|
||||
{
|
||||
pthread_mutex_t mut;
|
||||
public:
|
||||
NgMutex ()
|
||||
{
|
||||
pthread_mutex_init (&mut, NULL);
|
||||
}
|
||||
friend class NgLock;
|
||||
};
|
||||
|
||||
class NgLock
|
||||
{
|
||||
pthread_mutex_t & mut;
|
||||
bool locked;
|
||||
public:
|
||||
NgLock (NgMutex & ngmut, bool lock = false)
|
||||
: mut (ngmut.mut)
|
||||
{
|
||||
if (lock)
|
||||
pthread_mutex_lock (&mut);
|
||||
|
||||
locked = lock;
|
||||
};
|
||||
|
||||
~NgLock()
|
||||
{
|
||||
if (locked)
|
||||
pthread_mutex_unlock (&mut);
|
||||
}
|
||||
|
||||
void Lock ()
|
||||
{
|
||||
pthread_mutex_lock (&mut);
|
||||
locked = true;
|
||||
}
|
||||
void UnLock ()
|
||||
{
|
||||
pthread_mutex_unlock (&mut);
|
||||
locked = false;
|
||||
}
|
||||
/*
|
||||
int TryLock ()
|
||||
{
|
||||
return pthread_mutex_trylock (&mut);
|
||||
}
|
||||
*/
|
||||
};
|
||||
|
||||
#else // Using MS VC++ Standard / Enterprise / Professional edition...
|
||||
|
||||
|
||||
class NgMutex
|
||||
{
|
||||
CCriticalSection cs;
|
||||
@ -68,6 +123,8 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
#endif // MSVC_EXPRESS
|
||||
|
||||
#else
|
||||
|
||||
|
||||
|
@ -62,17 +62,23 @@ namespace metis { extern "C" {
|
||||
#ifdef _MSC_VER
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# ifndef NO_PARALLEL_THREADS
|
||||
# include <afxwin.h>
|
||||
# include <afxmt.h>
|
||||
# ifdef MSVC_EXPRESS
|
||||
# include <pthread.h>
|
||||
# else
|
||||
# include <afxwin.h>
|
||||
# include <afxmt.h>
|
||||
# endif // MSVC_EXPRESS
|
||||
# endif
|
||||
# include <windows.h>
|
||||
# undef WIN32_LEAN_AND_MEAN
|
||||
# include <winnt.h>
|
||||
|
||||
#else
|
||||
#else // Not using MC VC++
|
||||
|
||||
# ifndef NO_PARALLEL_THREADS
|
||||
# include <pthread.h>
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
530
ng/ngpkg.cpp
530
ng/ngpkg.cpp
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user