Skip to content
Permalink
Browse files

Added a declaration for Mac to avoid exception declaration conflict.

  • Loading branch information...
emeryberger committed Apr 15, 2019
1 parent a49b613 commit aeb626e7267eb55ec1855f3d261943c6fb298182
Showing with 15 additions and 2 deletions.
  1. +8 −1 src/unit/concurrent_mesh_test.cc
  2. +7 −1 src/unit/triple_mesh_test.cc
@@ -31,8 +31,15 @@ static atomic<int> ShouldContinueTest;
// we need to wrap pthread_create so that we can safely implement a
// stop-the-world quiescent period for the copy/mremap phase of
// meshing -- copied from libmesh.cc

#ifdef __APPLE__
#define PTHREAD_CREATE_THROW
#else
#define PTHREAD_CREATE_THROW throw()
#endif

extern "C" int pthread_create(pthread_t *thread, const pthread_attr_t *attr, mesh::PthreadFn startRoutine,
void *arg) throw() {
void *arg) PTHREAD_CREATE_THROW {
return mesh::runtime().createThread(thread, attr, startRoutine, arg);
}

@@ -31,11 +31,17 @@ static atomic<int> ShouldContinueTest1;
static atomic<int> ShouldExit2;
static atomic<int> ShouldContinueTest2;

#ifdef __APPLE__
#define PTHREAD_CREATE_THROW
#else
#define PTHREAD_CREATE_THROW throw()
#endif

// we need to wrap pthread_create so that we can safely implement a
// stop-the-world quiescent period for the copy/mremap phase of
// meshing -- copied from libmesh.cc
extern "C" int pthread_create(pthread_t *thread, const pthread_attr_t *attr, mesh::PthreadFn startRoutine,
void *arg) throw();
void *arg) PTHREAD_CREATE_THROW;

static void writerThread1() {
ShouldContinueTest1 = 1;

0 comments on commit aeb626e

Please sign in to comment.
You can’t perform that action at this time.