thr_cond.c (300971) | thr_cond.c (301136) |
---|---|
1/* 2 * Copyright (c) 2005 David Xu <davidxu@freebsd.org> 3 * Copyright (c) 2015 The FreeBSD Foundation 4 * All rights reserved. 5 * 6 * Portions of this software were developed by Konstantin Belousov 7 * under sponsorship from the FreeBSD Foundation. 8 * --- 15 unchanged lines hidden (view full) --- 24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 */ 30 31#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 2005 David Xu <davidxu@freebsd.org> 3 * Copyright (c) 2015 The FreeBSD Foundation 4 * All rights reserved. 5 * 6 * Portions of this software were developed by Konstantin Belousov 7 * under sponsorship from the FreeBSD Foundation. 8 * --- 15 unchanged lines hidden (view full) --- 24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 */ 30 31#include <sys/cdefs.h> |
32__FBSDID("$FreeBSD: head/lib/libthr/thread/thr_cond.c 300971 2016-05-29 19:35:55Z kib $"); | 32__FBSDID("$FreeBSD: head/lib/libthr/thread/thr_cond.c 301136 2016-06-01 16:12:26Z cem $"); |
33 34#include "namespace.h" 35#include <stdlib.h> 36#include <errno.h> 37#include <string.h> 38#include <pthread.h> 39#include <limits.h> 40#include "un-namespace.h" --- 212 unchanged lines hidden (view full) --- 253 const struct timespec *abstime, int cancel) 254{ 255 struct pthread *curthread; 256 struct sleepqueue *sq; 257 int deferred, error, error2, recurse; 258 259 curthread = _get_curthread(); 260 if (curthread->wchan != NULL) | 33 34#include "namespace.h" 35#include <stdlib.h> 36#include <errno.h> 37#include <string.h> 38#include <pthread.h> 39#include <limits.h> 40#include "un-namespace.h" --- 212 unchanged lines hidden (view full) --- 253 const struct timespec *abstime, int cancel) 254{ 255 struct pthread *curthread; 256 struct sleepqueue *sq; 257 int deferred, error, error2, recurse; 258 259 curthread = _get_curthread(); 260 if (curthread->wchan != NULL) |
261 PANIC("thread was already on queue."); | 261 PANIC("thread %p was already on queue.", curthread); |
262 263 if (cancel) 264 _thr_testcancel(curthread); 265 266 _sleepq_lock(cvp); 267 /* 268 * set __has_user_waiters before unlocking mutex, this allows 269 * us to check it without locking in pthread_cond_signal(). --- 262 unchanged lines hidden --- | 262 263 if (cancel) 264 _thr_testcancel(curthread); 265 266 _sleepq_lock(cvp); 267 /* 268 * set __has_user_waiters before unlocking mutex, this allows 269 * us to check it without locking in pthread_cond_signal(). --- 262 unchanged lines hidden --- |