Skip to content

Commit

Permalink
Merge pull request #2107 from wiredtiger/pthread-create-retry
Browse files Browse the repository at this point in the history
SERVER-19751 Retry pthread_create on EAGAIN or EINTR.
  • Loading branch information
keithbostic committed Aug 5, 2015
2 parents c5c9936 + 4a32263 commit b52d2d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/include/os.h
Expand Up @@ -56,7 +56,7 @@ typedef enum {
case EMFILE: \
case ENFILE: \
case ENOSPC: \
__wt_sleep(0L, 500000L); \
__wt_sleep(0L, 50000L); \
continue; \
default: \
break; \
Expand Down
6 changes: 4 additions & 2 deletions src/os_posix/os_thread.c
Expand Up @@ -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");
}
Expand All @@ -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");
Expand Down

0 comments on commit b52d2d3

Please sign in to comment.