Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset b7398c0 in mainline


Ignore:
Timestamp:
2010-05-25T21:32:32Z (11 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master
Children:
5df7928
Parents:
a9f1372
Message:

Add interfaces for getting and setting the waitq missed_wakeups.

Location:
kernel/generic
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/synch/waitq.h

    ra9f1372 rb7398c0  
    8080extern void waitq_interrupt_sleep(struct thread *);
    8181extern void waitq_unsleep(waitq_t *);
     82extern int waitq_count_get(waitq_t *);
     83extern void waitq_count_set(waitq_t *, int val);
    8284
    8385#endif
  • kernel/generic/src/synch/waitq.c

    ra9f1372 rb7398c0  
    505505}
    506506
     507/** Get the missed wakeups count.
     508 *
     509 * @param wq    Pointer to wait queue.
     510 * @return      The wait queue's missed_wakeups count.
     511 */
     512int waitq_count_get(waitq_t *wq)
     513{
     514        int cnt;
     515
     516        irq_spinlock_lock(&wq->lock, true);
     517        cnt = wq->missed_wakeups;
     518        irq_spinlock_unlock(&wq->lock, true);
     519
     520        return cnt;
     521}
     522
     523/** Set the missed wakeups count.
     524 *
     525 * @param wq    Pointer to wait queue.
     526 * @param val   New value of the missed_wakeups count.
     527 */
     528void waitq_count_set(waitq_t *wq, int val)
     529{
     530        irq_spinlock_lock(&wq->lock, true);
     531        wq->missed_wakeups = val;
     532        irq_spinlock_unlock(&wq->lock, true);
     533}
     534
    507535/** @}
    508536 */
Note: See TracChangeset for help on using the changeset viewer.