commit: r863 - in vendor/stdutil/current: . include src src/stdutil src/stdutil/private
[email protected] Thu, 17 Nov 2016 14:01:02 -0500
| Newsgroups | gmane.network.spread.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: jschultz Date: 2016-11-17 14:01:01 -0500 (Thu, 17 Nov 2016) New Revision: 863 Added: vendor/stdutil/current/include/ vendor/stdutil/current/include/stdutil Modified: vendor/stdutil/current/CHANGELOG vendor/stdutil/current/Makefile vendor/stdutil/current/README vendor/stdutil/current/STDUTIL_LICENSE vendor/stdutil/current/src/stdarr.c vendor/stdutil/current/src/stdcarr.c vendor/stdutil/current/src/stdfd.c vendor/stdutil/current/src/stdhash.c vendor/stdutil/current/src/stdit.c vendor/stdutil/current/src/stdskl.c vendor/stdutil/current/src/stdthread.c vendor/stdutil/current/src/stdtime.c vendor/stdutil/current/src/stdutil.c vendor/stdutil/current/src/stdutil/private/stdarch.h vendor/stdutil/current/src/stdutil/private/stdarch_autoconf.h.in vendor/stdutil/current/src/stdutil/private/stdarch_wintel32.h vendor/stdutil/current/src/stdutil/private/stdarr_p.h vendor/stdutil/current/src/stdutil/private/stdcarr_p.h vendor/stdutil/current/src/stdutil/private/stddll_p.h vendor/stdutil/current/src/stdutil/private/stdhash_p.h vendor/stdutil/current/src/stdutil/private/stdit_p.h vendor/stdutil/current/src/stdutil/private/stdskl_p.h vendor/stdutil/current/src/stdutil/private/stdthread_p.h vendor/stdutil/current/src/stdutil/stdarr.h vendor/stdutil/current/src/stdutil/stdcarr.h vendor/stdutil/current/src/stdutil/stddefines.h vendor/stdutil/current/src/stdutil/stddll.h vendor/stdutil/current/src/stdutil/stderror.h vendor/stdutil/current/src/stdutil/stdfd.h vendor/stdutil/current/src/stdutil/stdhash.h vendor/stdutil/current/src/stdutil/stdit.h vendor/stdutil/current/src/stdutil/stdskl.h vendor/stdutil/current/src/stdutil/stdthread.h vendor/stdutil/current/src/stdutil/stdtime.h vendor/stdutil/current/src/stdutil/stdutil.h Log: Load 1.1.3 into vendor/stdutil/current. Modified: vendor/stdutil/current/CHANGELOG =================================================================== --- vendor/stdutil/current/CHANGELOG 2016-11-17 18:50:54 UTC (rev 862) +++ vendor/stdutil/current/CHANGELOG 2016-11-17 19:01:01 UTC (rev 863) @@ -1,3 +1,15 @@ +v1.1.3, January 2012 + +Few minor bug fixes and improvements. + +v1.1.2, May 2010 + +Added a timedwait function to stdthread.h Not currently supported on Win32. + +v1.1.1, April 2010 + +Changed top level Makefile to automatically run configure if not already done. + v1.1.0, May 2009 Changed the build so that the functions in stdthread.h are always defined, but most will simply Modified: vendor/stdutil/current/Makefile =================================================================== --- vendor/stdutil/current/Makefile 2016-11-17 18:50:54 UTC (rev 862) +++ vendor/stdutil/current/Makefile 2016-11-17 19:01:01 UTC (rev 863) @@ -1,4 +1,4 @@ -all: +all: src/Makefile cd src; $(MAKE) all clean: @@ -15,3 +15,7 @@ rm -rf autom4te.cache rm -f configure cd src; $(MAKE) uberclean + +src/Makefile: + ./configure + Modified: vendor/stdutil/current/README =================================================================== --- vendor/stdutil/current/README 2016-11-17 18:50:54 UTC (rev 862) +++ vendor/stdutil/current/README 2016-11-17 19:01:01 UTC (rev 863) @@ -1,4 +1,4 @@ -This is the v1.1.0 (May 2009) distribution of the StdUtil library. +This is the v1.1.3 (January 2012) distribution of the StdUtil library. DESCRIPTION: @@ -16,7 +16,7 @@ subsequent release in HTML format in the docs directory. The documentation will also be available at: -http://www.cnds.jhu.edu/software/stdutil/docs +http://www.stdutil.org BUILDING: @@ -26,10 +26,10 @@ PROBLEMS: -Please report bugs and/or bug fixes to [email protected] with a +Please report bugs and/or bug fixes to [email protected] with a gdb compatible core (if possible) and any information that could help fix the problem. Enjoy, -John Schultz <[email protected]> -May 2009 +John Schultz <[email protected]> +January 2012 Modified: vendor/stdutil/current/STDUTIL_LICENSE =================================================================== --- vendor/stdutil/current/STDUTIL_LICENSE 2016-11-17 18:50:54 UTC (rev 862) +++ vendor/stdutil/current/STDUTIL_LICENSE 2016-11-17 19:01:01 UTC (rev 863) @@ -1,11 +1,11 @@ -/* Copyright (c) 2000-2009, The Johns Hopkins University +/* Copyright (c) 2000-2012, The Johns Hopkins University * All rights reserved. * * The Original Software is: * The StdUtil Library * * Contributors: - * Creator - John Lane Schultz ([email protected]) + * Creator - John Lane Schultz ([email protected]) * The Center for Networking and Distributed Systems * (CNDS - http://www.cnds.jhu.edu) * @@ -31,8 +31,6 @@ * The Johns Hopkins University * 3400 N. Charles St., MD 21218 * - * or email director [at] cnds.jhu.edu. - * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS Added: vendor/stdutil/current/include/stdutil =================================================================== --- vendor/stdutil/current/include/stdutil (rev 0) +++ vendor/stdutil/current/include/stdutil 2016-11-17 19:01:01 UTC (rev 863) @@ -0,0 +1 @@ +link ../src/stdutil \ No newline at end of file Property changes on: vendor/stdutil/current/include/stdutil ___________________________________________________________________ Added: svn:special + * Modified: vendor/stdutil/current/src/stdarr.c =================================================================== --- vendor/stdutil/current/src/stdarr.c 2016-11-17 18:50:54 UTC (rev 862) +++ vendor/stdutil/current/src/stdarr.c 2016-11-17 19:01:01 UTC (rev 863) @@ -1,4 +1,4 @@ -/* Copyright (c) 2000-2009, The Johns Hopkins University +/* Copyright (c) 2000-2012, The Johns Hopkins University * All rights reserved. * * The contents of this file are subject to a license (the ``License''). Modified: vendor/stdutil/current/src/stdcarr.c =================================================================== --- vendor/stdutil/current/src/stdcarr.c 2016-11-17 18:50:54 UTC (rev 862) +++ vendor/stdutil/current/src/stdcarr.c 2016-11-17 19:01:01 UTC (rev 863) @@ -1,4 +1,4 @@ -/* Copyright (c) 2000-2009, The Johns Hopkins University +/* Copyright (c) 2000-2012, The Johns Hopkins University * All rights reserved. * * The contents of this file are subject to a license (the ``License''). Modified: vendor/stdutil/current/src/stdfd.c =================================================================== --- vendor/stdutil/current/src/stdfd.c 2016-11-17 18:50:54 UTC (rev 862) +++ vendor/stdutil/current/src/stdfd.c 2016-11-17 19:01:01 UTC (rev 863) @@ -1,4 +1,4 @@ -/* Copyright (c) 2000-2009, The Johns Hopkins University +/* Copyright (c) 2000-2012, The Johns Hopkins University * All rights reserved. * * The contents of this file are subject to a license (the ``License''). Modified: vendor/stdutil/current/src/stdhash.c =================================================================== --- vendor/stdutil/current/src/stdhash.c 2016-11-17 18:50:54 UTC (rev 862) +++ vendor/stdutil/current/src/stdhash.c 2016-11-17 19:01:01 UTC (rev 863) @@ -1,4 +1,4 @@ -/* Copyright (c) 2000-2009, The Johns Hopkins University +/* Copyright (c) 2000-2012, The Johns Hopkins University * All rights reserved. * * The contents of this file are subject to a license (the ``License''). @@ -505,21 +505,25 @@ search = stdhash_low_find(h, overwrite, key, &hcode); - if (STDHASH_POS_EMPTY(search)) { /* found a truly empty hole: create+insert a new node */ + if (STDHASH_POS_EMPTY(search)) { /* if we found a truly empty hole: create+insert a new node */ if ((*search = (stdhash_node*) malloc(STDHASH_NODE_SIZE(h->ksize, h->vsize))) == NULL) { ret = STDENOMEM; goto stdhash_low_insert_end; } - ++h->num_nodes; /* increased # of nodes in table */ - } /* else found a useable node */ + ++h->num_nodes; /* increased # of nodes in and size of table */ + ++h->size; - /* update the table's meta information */ + } else if (!overwrite) { /* else if !overwrite -> we found an inactive node we can reuse */ + STDSAFETY_CHECK(STDHASH_POS_INACTIVE(search)); + ++h->size; - ++h->size; + } else { /* else we found and are overwriting an existing node; num_nodes and size don't change */ + STDSAFETY_CHECK(!STDHASH_POS_INACTIVE(search)); + } - if (search < h->begin) { /* insert was before begin */ + if (search < h->begin) { /* if insert was before begin */ h->begin = search; } Modified: vendor/stdutil/current/src/stdit.c =================================================================== --- vendor/stdutil/current/src/stdit.c 2016-11-17 18:50:54 UTC (rev 862) +++ vendor/stdutil/current/src/stdit.c 2016-11-17 19:01:01 UTC (rev 863) @@ -1,4 +1,4 @@ -/* Copyright (c) 2000-2009, The Johns Hopkins University +/* Copyright (c) 2000-2012, The Johns Hopkins University * All rights reserved. * * The contents of this file are subject to a license (the ``License''). Modified: vendor/stdutil/current/src/stdskl.c =================================================================== --- vendor/stdutil/current/src/stdskl.c 2016-11-17 18:50:54 UTC (rev 862) +++ vendor/stdutil/current/src/stdskl.c 2016-11-17 19:01:01 UTC (rev 863) @@ -1,4 +1,4 @@ -/* Copyright (c) 2000-2009, The Johns Hopkins University +/* Copyright (c) 2000-2012, The Johns Hopkins University * All rights reserved. * * The contents of this file are subject to a license (the ``License''). Modified: vendor/stdutil/current/src/stdthread.c =================================================================== --- vendor/stdutil/current/src/stdthread.c 2016-11-17 18:50:54 UTC (rev 862) +++ vendor/stdutil/current/src/stdthread.c 2016-11-17 19:01:01 UTC (rev 863) @@ -1,4 +1,4 @@ -/* Copyright (c) 2000-2009, The Johns Hopkins University +/* Copyright (c) 2000-2012, The Johns Hopkins University * All rights reserved. * * The contents of this file are subject to a license (the ``License''). @@ -537,11 +537,11 @@ * stdmutex_fast_cond_wait: Wait on a condition protected by a fast mutex. ***********************************************************************************************/ -STDINLINE static stdcode stdmutex_fast_cond_wait(stdmutex *mut, stdcond *cond) +STDINLINE static stdcode stdmutex_fast_cond_timedwait(stdmutex *mut, stdcond *cond, const stdtime *abs_time) # if defined(_WIN32) { /* NOTE: this WIN32 code works for both fast and recursive mutexes: - the WIN32 stdmutex_rcrsv_cond_wait is a call through to this fcn + the WIN32 stdmutex_rcrsv_cond_timedwait is a call through to this fcn */ stdcode ret = STDESUCCESS; @@ -556,22 +556,29 @@ STDSAFETY_CHECK(mut->mut_type == STDMUTEX_FAST || mut->mut_type == STDMUTEX_RCRSV); + /* NOTE: we can't implement timedwaits on windows yet */ + + if (abs_time != NULL) { + ret = STDENOSYS; + goto stdmutex_fast_cond_timedwait_end; + } + /* check for recursive mutexes that owner only has one lock */ if (mut->mut_type == STDMUTEX_RCRSV) { if ((ret = stdmutex_is_owner(mut, &grab_cnt)) != STDESUCCESS) { - goto stdmutex_fast_cond_wait_end; + goto stdmutex_fast_cond_timedwait_end; } if (grab_cnt == 0) { ret = STDEPERM; - goto stdmutex_fast_cond_wait_end; + goto stdmutex_fast_cond_timedwait_end; } if (grab_cnt != 1) { ret = STDEBUSY; - goto stdmutex_fast_cond_wait_end; + goto stdmutex_fast_cond_timedwait_end; } } @@ -585,26 +592,26 @@ if (DuplicateHandle(curr_proc, curr_thread, curr_proc, &dup_handle, 0, TRUE, DUPLICATE_SAME_ACCESS) == 0) { ret = (stdcode) GetLastError(); - goto stdmutex_fast_cond_wait_end; + goto stdmutex_fast_cond_timedwait_end; } /* allocate a node to put in the condition's linked list of sleeping threads */ if ((my_link = (stdcond_link*) malloc(sizeof(stdcond_link))) == NULL) { ret = STDENOMEM; - goto stdmutex_fast_cond_wait_malloc; + goto stdmutex_fast_cond_timedwait_malloc; } /* grab the condition's internal lock */ if ((ret = stdmutex_impl_grab(&cond->lock, STDTRUE)) != STDESUCCESS) { - goto stdmutex_fast_cond_wait_grab_cond; + goto stdmutex_fast_cond_timedwait_grab_cond; } /* drop mut */ if ((ret = stdmutex_drop(mut)) != STDESUCCESS) { - goto stdmutex_fast_cond_wait_drop_mut; + goto stdmutex_fast_cond_timedwait_drop_mut; } reacquire = STDTRUE; /* try to reacquire mut at end of this fcn */ @@ -613,14 +620,14 @@ if ((prev_priority = GetThreadPriority(curr_thread)) == THREAD_PRIORITY_ERROR_RETURN) { ret = (stdcode) GetLastError(); - goto stdmutex_fast_cond_wait_ThreadPriority; + goto stdmutex_fast_cond_timedwait_ThreadPriority; } /* bump up priority so that waker thread can never infinitely loop in a wake call (see below) */ if (SetThreadPriority(curr_thread, THREAD_PRIORITY_HIGHEST) == 0) { ret = (stdcode) GetLastError(); - goto stdmutex_fast_cond_wait_ThreadPriority; + goto stdmutex_fast_cond_timedwait_ThreadPriority; } /* link onto end of sleepers list */ @@ -665,22 +672,22 @@ ret = (stdcode) GetLastError(); } - goto stdmutex_fast_cond_wait_end; + goto stdmutex_fast_cond_timedwait_end; /* error handling and return */ - stdmutex_fast_cond_wait_ThreadPriority: - stdmutex_fast_cond_wait_drop_mut: + stdmutex_fast_cond_timedwait_ThreadPriority: + stdmutex_fast_cond_timedwait_drop_mut: stdmutex_impl_drop(&cond->lock); - stdmutex_fast_cond_wait_grab_cond: + stdmutex_fast_cond_timedwait_grab_cond: free(my_link); - stdmutex_fast_cond_wait_malloc: + stdmutex_fast_cond_timedwait_malloc: CloseHandle(dup_handle); STDSAFETY_CHECK(ret != STDESUCCESS); - stdmutex_fast_cond_wait_end: + stdmutex_fast_cond_timedwait_end: if (reacquire) { ret |= stdmutex_grab(mut); } @@ -689,9 +696,22 @@ } # else { + stdcode ret; + struct timespec timeout; + STDSAFETY_CHECK(mut->mut_type == STDMUTEX_FAST); - return pthread_cond_wait(cond, &mut->mut.fast); + if (abs_time == NULL) { + ret = pthread_cond_wait(cond, &mut->mut.fast); + + } else { + timeout.tv_sec = abs_time->sec; + timeout.tv_nsec = abs_time->nano; + + ret = pthread_cond_timedwait(cond, &mut->mut.fast, &timeout); + } + + return ret; } # endif @@ -894,59 +914,70 @@ } /************************************************************************************************ - * stdmutex_rcrsv_cond_wait: Atomically unlock a 'mut' and wait on 'cond.' + * stdmutex_rcrsv_cond_timedwait: Atomically unlock a 'mut' and wait on 'cond' or until abs_time ***********************************************************************************************/ -STDINLINE static stdcode stdmutex_rcrsv_cond_wait(stdmutex *mut, stdcond *cond) +STDINLINE static stdcode stdmutex_rcrsv_cond_timedwait(stdmutex *mut, stdcond *cond, const stdtime *abs_time) # if defined(_WIN32) { /* NOTE: the WIN32 code works for both fast and recursive mutexes: - currently stdmutex_rcrsv_cond_wait is just a call through + currently stdmutex_rcrsv_cond_timedwait is just a call through */ - return stdmutex_fast_cond_wait(mut, cond); + return stdmutex_fast_cond_timedwait(mut, cond); } # else { stdcode ret; stdmutex_rcrsv * rmut = &mut->mut.rcrsv; + struct timespec timeout; STDSAFETY_CHECK(mut->mut_type == STDMUTEX_RCRSV); if ((ret = stdmutex_impl_grab(&rmut->outer_lock, STDTRUE)) != STDESUCCESS) { - goto stdmutex_rcrsv_cond_wait_end; + goto stdmutex_rcrsv_cond_timedwait_end; } if (mut->mut_type != STDMUTEX_RCRSV || rmut->owner_cnt < 0 || rmut->num_waiting < 0) { ret = STDEINVAL; - goto stdmutex_rcrsv_cond_wait_drop; + goto stdmutex_rcrsv_cond_timedwait_drop; } if (rmut->owner_cnt == 0 || !stdthread_eq(rmut->owner_id, stdthread_self())) { ret = STDEPERM; - goto stdmutex_rcrsv_cond_wait_drop; + goto stdmutex_rcrsv_cond_timedwait_drop; } if (rmut->owner_cnt != 1) { ret = STDEBUSY; - goto stdmutex_rcrsv_cond_wait_drop; + goto stdmutex_rcrsv_cond_timedwait_drop; } ++rmut->num_waiting; rmut->owner_cnt = 0; stdmutex_impl_drop(&rmut->outer_lock); - pthread_cond_wait(cond, &rmut->inner_lock); + + if (abs_time == NULL) { + ret = pthread_cond_wait(cond, &rmut->inner_lock); + + } else { + timeout.tv_sec = abs_time->sec; + timeout.tv_nsec = abs_time->nano; + + ret = pthread_cond_timedwait(cond, &rmut->inner_lock, &timeout); + } + stdmutex_impl_grab(&rmut->outer_lock, STDTRUE); --rmut->num_waiting; rmut->owner_cnt = 1; rmut->owner_id = stdthread_self(); - stdmutex_rcrsv_cond_wait_drop: + stdmutex_rcrsv_cond_timedwait_drop: stdmutex_impl_drop(&rmut->outer_lock); - stdmutex_rcrsv_cond_wait_end: + stdmutex_rcrsv_cond_timedwait_end: return ret; } # endif @@ -1195,45 +1226,27 @@ STDINLINE stdcode stdcond_wait(stdcond *cond, stdmutex *mut) { - stdcode ret = STDEINVAL; - - switch (mut->mut_type) { - - case STDMUTEX_FAST: - ret = stdmutex_fast_cond_wait(mut, cond); - break; - - case STDMUTEX_RCRSV: - ret = stdmutex_rcrsv_cond_wait(mut, cond); - break; - - case STDMUTEX_NULL: - ret = STDESUCCESS; - break; - } - - return ret; + return stdcond_timedwait(cond, mut, NULL); } -#if 0 /* comment out stdcond_wait_timed */ - /************************************************************************************************ - * stdcond_wait_timed: + * stdcond_timedwait: ***********************************************************************************************/ -STDINLINE stdcode stdcond_wait_timed(stdcond * cond, - stdmutex * mut) +STDINLINE stdcode stdcond_timedwait(stdcond * cond, + stdmutex * mut, + const stdtime * abs_time) { stdcode ret = STDEINVAL; switch (mut->mut_type) { case STDMUTEX_FAST: - ret = stdmutex_fast_cond_wait_timed(mut, cond); + ret = stdmutex_fast_cond_timedwait(mut, cond, abs_time); break; case STDMUTEX_RCRSV: - ret = stdmutex_rcrsv_cond_wait_timed(mut, cond); + ret = stdmutex_rcrsv_cond_timedwait(mut, cond, abs_time); break; case STDMUTEX_NULL: @@ -1244,91 +1257,8 @@ return ret; } -/************************************************************************************************ - * stdcond_wait_timed: - ***********************************************************************************************/ - -STDINLINE stdcode stdcond_wait_timed(stdcond *cond, stdmutex *mut, const stdtime *abs_time) -# if defined(_WIN32) -{ - /* TODO: figure out how + implement me! */ - return ENOSYS; -} -# else -{ - /* TODO: needs work; make it look like stdmutex_*_cond_wait */ - struct timespec timeout; - stdmutex_impl * mut_impl = NULL; - long grab_cnt = 0; - stdcode ret; - - timeout.tv_sec = abs_time->m_Sec; - timeout.tv_nsec = abs_time->m_Nsec; - - if ((ret = stdmutex_is_owner(mut, &grab_cnt)) != STDESUCCESS) { - assert(STDFALSE /* stdcond_wait_timed: user race condition on mut, protect calls to fini! */); - goto stdcond_wait_timed_fail; - } - - if (grab_cnt == 0) { - assert(STDFALSE /* stdcond_wait_timed: user doesn't own mut! */); - ret = EPERM; - goto stdcond_wait_timed_EPERM; - } - - if (grab_cnt != 1) { - assert(STDFALSE /* stdcond_wait: recursive mutex must have a grab_cnt of 1! */); - ret = EINVAL; - goto stdcond_wait_timed_EINVAL; - } - - switch (mut->mut_type) { - case STDMUTEX_FAST: - { - stdmutex_fast * fmut = &mut->m_Mutex.m_Fast; - - fmut->owner_cnt = 0; - mut_impl = &fmut->m_Lock; - } - break; - - case STDMUTEX_RCRSV: - { - stdmutex_rcrsv * rmut = &mut->mut.rcrsv; - - rmut->owner_cnt = 0; - mut_impl = &rmut->inner_lock; - } - break; - - default: - assert(STDFALSE); - ret = EINVAL; - goto stdcond_wait_timed_EINVAL; - } - - if ((ret = pthread_cond_timedwait(cond, mut_impl, &timeout)) != STDESUCCESS) { - goto stdcond_wait_timed_pcond_timedwait; - } - - assert(ret == STDESUCCESS); - goto stdcond_wait_timed_end; - - /* error handling and return */ - - stdcond_wait_timed_pcond_timedwait: - stdcond_wait_timed_EINVAL: - stdcond_wait_timed_fail: - assert(ret != STDESUCCESS); - - stdcond_wait_timed_end: - return ret; -} -# endif #endif -#endif - #ifdef __cplusplus } #endif Modified: vendor/stdutil/current/src/stdtime.c =================================================================== --- vendor/stdutil/current/src/stdtime.c 2016-11-17 18:50:54 UTC (rev 862) +++ vendor/stdutil/current/src/stdtime.c 2016-11-17 19:01:01 UTC (rev 863) @@ -1,4 +1,4 @@ -/* Copyright (c) 2000-2009, The Johns Hopkins University +/* Copyright (c) 2000-2012, The Johns Hopkins University * All rights reserved. * * The contents of this file are subject to a license (the ``License''). Modified: vendor/stdutil/current/src/stdutil/private/stdarch.h =================================================================== --- vendor/stdutil/current/src/stdutil/private/stdarch.h 2016-11-17 18:50:54 UTC (rev 862) +++ vendor/stdutil/current/src/stdutil/private/stdarch.h 2016-11-17 19:01:01 UTC (rev 863) @@ -1,4 +1,4 @@ -/* Copyright (c) 2000-2009, The Johns Hopkins University +/* Copyright (c) 2000-2012, The Johns Hopkins University * All rights reserved. * * The contents of this file are subject to a license (the ``License''). Modified: vendor/stdutil/current/src/stdutil/private/stdarch_autoconf.h.in =================================================================== --- vendor/stdutil/current/src/stdutil/private/stdarch_autoconf.h.in 2016-11-17 18:50:54 UTC (rev 862) +++ vendor/stdutil/current/src/stdutil/private/stdarch_autoconf.h.in 2016-11-17 19:01:01 UTC (rev 863) @@ -1,4 +1,4 @@ -/* Copyright (c) 2000-2009, The Johns Hopkins University +/* Copyright (c) 2000-2012, The Johns Hopkins University * All rights reserved. * * The contents of this file are subject to a license (the ``License''). Modified: vendor/stdutil/current/src/stdutil/private/stdarch_wintel32.h =================================================================== --- vendor/stdutil/current/src/stdutil/private/stdarch_wintel32.h 2016-11-17 18:50:54 UTC (rev 862) +++ vendor/stdutil/current/src/stdutil/private/stdarch_wintel32.h 2016-11-17 19:01:01 UTC (rev 863) @@ -1,4 +1,4 @@ -/* Copyright (c) 2000-2009, The Johns Hopkins University +/* Copyright (c) 2000-2012, The Johns Hopkins University * All rights reserved. * * The contents of this file are subject to a license (the ``License''). Modified: vendor/stdutil/current/src/stdutil/private/stdarr_p.h =================================================================== --- vendor/stdutil/current/src/stdutil/private/stdarr_p.h 2016-11-17 18:50:54 UTC (rev 862) +++ vendor/stdutil/current/src/stdutil/private/stdarr_p.h 2016-11-17 19:01:01 UTC (rev 863) @@ -1,4 +1,4 @@ -/* Copyright (c) 2000-2009, The Johns Hopkins University +/* Copyright (c) 2000-2012, The Johns Hopkins University * All rights reserved. * * The contents of this file are subject to a license (the ``License''). Modified: vendor/stdutil/current/src/stdutil/private/stdcarr_p.h =================================================================== --- vendor/stdutil/current/src/stdutil/private/stdcarr_p.h 2016-11-17 18:50:54 UTC (rev 862) +++ vendor/stdutil/current/src/stdutil/private/stdcarr_p.h 2016-11-17 19:01:01 UTC (rev 863) @@ -1,4 +1,4 @@ -/* Copyright (c) 2000-2009, The Johns Hopkins University +/* Copyright (c) 2000-2012, The Johns Hopkins University * All rights reserved. * * The contents of this file are subject to a license (the ``License''). Modified: vendor/stdutil/current/src/stdutil/private/stddll_p.h =================================================================== --- vendor/stdutil/current/src/stdutil/private/stddll_p.h 2016-11-17 18:50:54 UTC (rev 862) +++ vendor/stdutil/current/src/stdutil/private/stddll_p.h 2016-11-17 19:01:01 UTC (rev 863) @@ -1,4 +1,4 @@ -/* Copyright (c) 2000-2009, The Johns Hopkins University +/* Copyright (c) 2000-2012, The Johns Hopkins University * All rights reserved. * * The contents of this file are subject to a license (the ``License''). Modified: vendor/stdutil/current/src/stdutil/private/stdhash_p.h =================================================================== --- vendor/stdutil/current/src/stdutil/private/stdhash_p.h 2016-11-17 18:50:54 UTC (rev 862) +++ vendor/stdutil/current/src/stdutil/private/stdhash_p.h 2016-11-17 19:01:01 UTC (rev 863) @@ -1,4 +1,4 @@ -/* Copyright (c) 2000-2009, The Johns Hopkins University +/* Copyright (c) 2000-2012, The Johns Hopkins University * All rights reserved. * * The contents of this file are subject to a license (the ``License''). Modified: vendor/stdutil/current/src/stdutil/private/stdit_p.h =================================================================== --- vendor/stdutil/current/src/stdutil/private/stdit_p.h 2016-11-17 18:50:54 UTC (rev 862) +++ vendor/stdutil/current/src/stdutil/private/stdit_p.h 2016-11-17 19:01:01 UTC (rev 863) @@ -1,4 +1,4 @@ -/* Copyright (c) 2000-2009, The Johns Hopkins University +/* Copyright (c) 2000-2012, The Johns Hopkins University * All rights reserved. * * The contents of this file are subject to a license (the ``License''). Modified: vendor/stdutil/current/src/stdutil/private/stdskl_p.h =================================================================== --- vendor/stdutil/current/src/stdutil/private/stdskl_p.h 2016-11-17 18:50:54 UTC (rev 862) +++ vendor/stdutil/current/src/stdutil/private/stdskl_p.h 2016-11-17 19:01:01 UTC (rev 863) @@ -1,4 +1,4 @@ -/* Copyright (c) 2000-2009, The Johns Hopkins University +/* Copyright (c) 2000-2012, The Johns Hopkins University * All rights reserved. * * The contents of this file are subject to a license (the ``License''). Modified: vendor/stdutil/current/src/stdutil/private/stdthread_p.h =================================================================== --- vendor/stdutil/current/src/stdutil/private/stdthread_p.h 2016-11-17 18:50:54 UTC (rev 862) +++ vendor/stdutil/current/src/stdutil/private/stdthread_p.h 2016-11-17 19:01:01 UTC (rev 863) @@ -1,4 +1,4 @@ -/* Copyright (c) 2000-2009, The Johns Hopkins University +/* Copyright (c) 2000-2012, The Johns Hopkins University * All rights reserved. * * The contents of this file are subject to a license (the ``License''). Modified: vendor/stdutil/current/src/stdutil/stdarr.h =================================================================== --- vendor/stdutil/current/src/stdutil/stdarr.h 2016-11-17 18:50:54 UTC (rev 862) +++ vendor/stdutil/current/src/stdutil/stdarr.h 2016-11-17 19:01:01 UTC (rev 863) @@ -1,4 +1,4 @@ -/* Copyright (c) 2000-2009, The Johns Hopkins University +/* Copyright (c) 2000-2012, The Johns Hopkins University * All rights reserved. * * The contents of this file are subject to a license (the ``License''). Modified: vendor/stdutil/current/src/stdutil/stdcarr.h =================================================================== --- vendor/stdutil/current/src/stdutil/stdcarr.h 2016-11-17 18:50:54 UTC (rev 862) +++ vendor/stdutil/current/src/stdutil/stdcarr.h 2016-11-17 19:01:01 UTC (rev 863) @@ -1,4 +1,4 @@ -/* Copyright (c) 2000-2009, The Johns Hopkins University +/* Copyright (c) 2000-2012, The Johns Hopkins University * All rights reserved. * * The contents of this file are subject to a license (the ``License''). Modified: vendor/stdutil/current/src/stdutil/stddefines.h =================================================================== --- vendor/stdutil/current/src/stdutil/stddefines.h 2016-11-17 18:50:54 UTC (rev 862) +++ vendor/stdutil/current/src/stdutil/stddefines.h 2016-11-17 19:01:01 UTC (rev 863) @@ -1,4 +1,4 @@ -/* Copyright (c) 2000-2009, The Johns Hopkins University +/* Copyright (c) 2000-2012, The Johns Hopkins University * All rights reserved. * * The contents of this file are subject to a license (the ``License''). Modified: vendor/stdutil/current/src/stdutil/stddll.h =================================================================== --- vendor/stdutil/current/src/stdutil/stddll.h 2016-11-17 18:50:54 UTC (rev 862) +++ vendor/stdutil/current/src/stdutil/stddll.h 2016-11-17 19:01:01 UTC (rev 863) @@ -1,4 +1,4 @@ -/* Copyright (c) 2000-2009, The Johns Hopkins University +/* Copyright (c) 2000-2012, The Johns Hopkins University * All rights reserved. * * The contents of this file are subject to a license (the ``License''). Modified: vendor/stdutil/current/src/stdutil/stderror.h =================================================================== --- vendor/stdutil/current/src/stdutil/stderror.h 2016-11-17 18:50:54 UTC (rev 862) +++ vendor/stdutil/current/src/stdutil/stderror.h 2016-11-17 19:01:01 UTC (rev 863) @@ -1,4 +1,4 @@ -/* Copyright (c) 2000-2009, The Johns Hopkins University +/* Copyright (c) 2000-2012, The Johns Hopkins University * All rights reserved. * * The contents of this file are subject to a license (the ``License''). @@ -60,13 +60,13 @@ #define STDEXCEPTION(x) stderr_output(STDERR_ABORT, 0, "STDEXCEPTION: File: %s; Line: %d: %s", __FILE__, __LINE__, #x) #if defined(STDSAFETY_CHECKS) -# define STDSAFETY_CHECK(x) { if (!(x)) { STDEXCEPTION(safety check (x) failed); } } +# define STDSAFETY_CHECK(x) do { if (!(x)) { STDEXCEPTION(safety check (x) failed); } } while (0) #else # define STDSAFETY_CHECK(x) #endif #if defined(STDBOUNDS_CHECKS) -# define STDBOUNDS_CHECK(x) { if (!(x)) { STDEXCEPTION(bounds check (x) failed); } } +# define STDBOUNDS_CHECK(x) do { if (!(x)) { STDEXCEPTION(bounds check (x) failed); } } while (0) #else # define STDBOUNDS_CHECK(x) #endif Modified: vendor/stdutil/current/src/stdutil/stdfd.h =================================================================== --- vendor/stdutil/current/src/stdutil/stdfd.h 2016-11-17 18:50:54 UTC (rev 862) +++ vendor/stdutil/current/src/stdutil/stdfd.h 2016-11-17 19:01:01 UTC (rev 863) @@ -1,4 +1,4 @@ -/* Copyright (c) 2000-2009, The Johns Hopkins University +/* Copyright (c) 2000-2012, The Johns Hopkins University * All rights reserved. * * The contents of this file are subject to a license (the ``License''). Modified: vendor/stdutil/current/src/stdutil/stdhash.h =================================================================== --- vendor/stdutil/current/src/stdutil/stdhash.h 2016-11-17 18:50:54 UTC (rev 862) +++ vendor/stdutil/current/src/stdutil/stdhash.h 2016-11-17 19:01:01 UTC (rev 863) @@ -1,4 +1,4 @@ -/* Copyright (c) 2000-2009, The Johns Hopkins University +/* Copyright (c) 2000-2012, The Johns Hopkins University * All rights reserved. * * The contents of this file are subject to a license (the ``License''). Modified: vendor/stdutil/current/src/stdutil/stdit.h =================================================================== --- vendor/stdutil/current/src/stdutil/stdit.h 2016-11-17 18:50:54 UTC (rev 862) +++ vendor/stdutil/current/src/stdutil/stdit.h 2016-11-17 19:01:01 UTC (rev 863) @@ -1,4 +1,4 @@ -/* Copyright (c) 2000-2009, The Johns Hopkins University +/* Copyright (c) 2000-2012, The Johns Hopkins University * All rights reserved. * * The contents of this file are subject to a license (the ``License''). Modified: vendor/stdutil/current/src/stdutil/stdskl.h =================================================================== --- vendor/stdutil/current/src/stdutil/stdskl.h 2016-11-17 18:50:54 UTC (rev 862) +++ vendor/stdutil/current/src/stdutil/stdskl.h 2016-11-17 19:01:01 UTC (rev 863) @@ -1,4 +1,4 @@ -/* Copyright (c) 2000-2009, The Johns Hopkins University +/* Copyright (c) 2000-2012, The Johns Hopkins University * All rights reserved. * * The contents of this file are subject to a license (the ``License''). Modified: vendor/stdutil/current/src/stdutil/stdthread.h =================================================================== --- vendor/stdutil/current/src/stdutil/stdthread.h 2016-11-17 18:50:54 UTC (rev 862) +++ vendor/stdutil/current/src/stdutil/stdthread.h 2016-11-17 19:01:01 UTC (rev 863) @@ -1,4 +1,4 @@ -/* Copyright (c) 2000-2009, The Johns Hopkins University +/* Copyright (c) 2000-2012, The Johns Hopkins University * All rights reserved. * * The contents of this file are subject to a license (the ``License''). @@ -23,6 +23,7 @@ #define stdthread_h_2000_03_14_12_28_17_jschultz_at_cnds_jhu_edu #include <stdutil/stddefines.h> +#include <stdutil/stdtime.h> #ifdef __cplusplus extern "C" { @@ -72,7 +73,7 @@ STDINLINE stdcode stdcond_wake_all(stdcond *cond); STDINLINE stdcode stdcond_wait(stdcond *cond, stdmutex *mut); -/*STDINLINE stdcode stdcond_timedwait(stdcond *cond, stdmutex *mut, long ns);*/ +STDINLINE stdcode stdcond_timedwait(stdcond *cond, stdmutex *mut, const stdtime *abstime); # ifdef __cplusplus } Modified: vendor/stdutil/current/src/stdutil/stdtime.h =================================================================== --- vendor/stdutil/current/src/stdutil/stdtime.h 2016-11-17 18:50:54 UTC (rev 862) +++ vendor/stdutil/current/src/stdutil/stdtime.h 2016-11-17 19:01:01 UTC (rev 863) @@ -1,4 +1,4 @@ -/* Copyright (c) 2000-2009, The Johns Hopkins University +/* Copyright (c) 2000-2012, The Johns Hopkins University * All rights reserved. * * The contents of this file are subject to a license (the ``License''). Modified: vendor/stdutil/current/src/stdutil/stdutil.h =================================================================== --- vendor/stdutil/current/src/stdutil/stdutil.h 2016-11-17 18:50:54 UTC (rev 862) +++ vendor/stdutil/current/src/stdutil/stdutil.h 2016-11-17 19:01:01 UTC (rev 863) @@ -1,4 +1,4 @@ -/* Copyright (c) 2000-2009, The Johns Hopkins University +/* Copyright (c) 2000-2012, The Johns Hopkins University * All rights reserved. * * The contents of this file are subject to a license (the ``License''). Modified: vendor/stdutil/current/src/stdutil.c =================================================================== --- vendor/stdutil/current/src/stdutil.c 2016-11-17 18:50:54 UTC (rev 862) +++ vendor/stdutil/current/src/stdutil.c 2016-11-17 19:01:01 UTC (rev 863) @@ -1,4 +1,4 @@ -/* Copyright (c) 2000-2009, The Johns Hopkins University +/* Copyright (c) 2000-2012, The Johns Hopkins University * All rights reserved. * * The contents of this file are subject to a license (the ``License'').