Skip to content

Commit

Permalink
Add missing argument to WaitForSingleObject and use $is_win in configure
Browse files Browse the repository at this point in the history
to turn off pthreads.
  • Loading branch information
devinamatthews committed Oct 16, 2018
1 parent b8dfd82 commit 0b73209
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,9 @@ auto_detect()
# Set the linker flags. We need pthreads because it is needed for
# parts of bli_arch.c unrelated to bli_arch_string(), which is called
# by the main() function in ${main_c}.
ldflags="${LIBPTHREAD--lpthread}"
if [ $is_win = no ]; then
ldflags="${LIBPTHREAD--lpthread}"
fi

# Compile the auto-detect program using source code inside the
# framework.
Expand Down Expand Up @@ -2457,6 +2459,10 @@ main()
cflags_preset_esc=$(echo "${cflags_preset}" | sed 's/\//\\\//g')
ldflags_preset_esc=$(echo "${ldflags_preset}" | sed 's/\//\\\//g')

if [ $is_win = yes ]; then
libpthread_esc=
fi

# Typically, there are no slashes in the version variable. However,
# downstream maintainers (such as those for Debian) may create custom
# tags in their local clones such as "upstream/0.4.1", which obviously
Expand Down
2 changes: 1 addition & 1 deletion frame/base/bli_pthread_wrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ int pthread_create(pthread_t *thread, const pthread_attr_t *attr,

int pthread_join(pthread_t thread, void **retval)
{
if (!WaitForSingleObject(thread.handle)) return EAGAIN;
if (!WaitForSingleObject(thread.handle, INFINITE)) return EAGAIN;
if (retval) *retval = thread.retval;
return 0;
}
Expand Down

0 comments on commit 0b73209

Please sign in to comment.