Deleted Added
full compact
kernel.c (254591) kernel.c (255437)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 335 unchanged lines hidden (view full) ---

344 if (error == ETIMEDOUT)
345 return (-1);
346
347 ASSERT(error == 0);
348
349 return (1);
350}
351
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 335 unchanged lines hidden (view full) ---

344 if (error == ETIMEDOUT)
345 return (-1);
346
347 ASSERT(error == 0);
348
349 return (1);
350}
351
352/*ARGSUSED*/
353clock_t
354cv_timedwait_hires(kcondvar_t *cv, kmutex_t *mp, hrtime_t tim, hrtime_t res,
355 int flag)
356{
357 int error;
358 timestruc_t ts;
359 hrtime_t delta;
360
361 ASSERT(flag == 0);
362
363top:
364 delta = tim - gethrtime();
365 if (delta <= 0)
366 return (-1);
367
368 ts.tv_sec = delta / NANOSEC;
369 ts.tv_nsec = delta % NANOSEC;
370
371 ASSERT(mutex_owner(mp) == curthread);
372 mp->m_owner = NULL;
373 error = pthread_cond_timedwait(cv, &mp->m_lock, &ts);
374 mp->m_owner = curthread;
375
376 if (error == ETIMEDOUT)
377 return (-1);
378
379 if (error == EINTR)
380 goto top;
381
382 ASSERT(error == 0);
383
384 return (1);
385}
386
352void
353cv_signal(kcondvar_t *cv)
354{
355 VERIFY(cond_signal(cv) == 0);
356}
357
358void
359cv_broadcast(kcondvar_t *cv)

--- 733 unchanged lines hidden ---
387void
388cv_signal(kcondvar_t *cv)
389{
390 VERIFY(cond_signal(cv) == 0);
391}
392
393void
394cv_broadcast(kcondvar_t *cv)

--- 733 unchanged lines hidden ---