summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Bostic <keith.bostic@mongodb.com>2015-08-05 07:07:18 -0400
committerMichael Cahill <michael.cahill@mongodb.com>2015-08-06 12:13:07 +1000
commit7cb51cd688c2375a504f99d5c57674e7fdfbcee0 (patch)
tree77ab6736ac7fdb7298309317e2ab30c3d9210705
parentf9572e20ad2de5372bd9c47ea0611a0b95dd92e5 (diff)
downloadmongo-7cb51cd688c2375a504f99d5c57674e7fdfbcee0.tar.gz
SERVER-19751 Retry pthread_create on EAGAIN or EINTR.
Merge pull request #2107 from wiredtiger/pthread-create-retry (cherry picked from commit b52d2d3a9cfdfa32ac2eacf3d3d5f281395d834f)
-rw-r--r--src/include/os.h2
-rw-r--r--src/os_posix/os_thread.c6
2 files changed, 5 insertions, 3 deletions
diff --git a/src/include/os.h b/src/include/os.h
index ba5d95657d5..edb59b0f521 100644
--- a/src/include/os.h
+++ b/src/include/os.h
@@ -56,7 +56,7 @@ typedef enum {
case EMFILE: \
case ENFILE: \
case ENOSPC: \
- __wt_sleep(0L, 500000L); \
+ __wt_sleep(0L, 50000L); \
continue; \
default: \
break; \
diff --git a/src/os_posix/os_thread.c b/src/os_posix/os_thread.c
index c70a04c8df7..10eeef558bc 100644
--- a/src/os_posix/os_thread.c
+++ b/src/os_posix/os_thread.c
@@ -19,7 +19,8 @@ __wt_thread_create(WT_SESSION_IMPL *session,
WT_DECL_RET;
/* Spawn a new thread of control. */
- if ((ret = pthread_create(tidret, NULL, func, arg)) == 0)
+ WT_SYSCALL_RETRY(pthread_create(tidret, NULL, func, arg), ret);
+ if (ret == 0)
return (0);
WT_RET_MSG(session, ret, "pthread_create");
}
@@ -33,7 +34,8 @@ __wt_thread_join(WT_SESSION_IMPL *session, wt_thread_t tid)
{
WT_DECL_RET;
- if ((ret = pthread_join(tid, NULL)) == 0)
+ WT_SYSCALL_RETRY(pthread_join(tid, NULL), ret);
+ if (ret == 0)
return (0);
WT_RET_MSG(session, ret, "pthread_join");