Changeset 0b8fad2 in mainline for kernel/generic/src/synch/syswaitq.c


Ignore:
Timestamp:
2018-11-11T15:47:39Z (6 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6874bd2
Parents:
25f6bddb
git-author:
Jakub Jermar <jakub@…> (2018-11-11 11:08:58)
git-committer:
Jakub Jermar <jakub@…> (2018-11-11 15:47:39)
Message:

Make user waitq more generic

By allowing SYS_WAITQ_SLEEP to specify flags, the implementation needn't
hardcode the use of SYNCH_FLAGS_FUTEX, resulting in a more generic
synchronization primitive usable from userspace.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/synch/syswaitq.c

    r25f6bddb r0b8fad2  
    143143 * @param whandle  Waitq capability handle of the waitq in which to sleep.
    144144 * @param timeout  Timeout in microseconds.
     145 * @param flags    Flags from SYNCH_FLAGS_* family. SYNCH_FLAGS_INTERRUPTIBLE is
     146 *                 always implied.
    145147 *
    146148 * @return         Error code.
    147149 */
    148 sys_errno_t sys_waitq_sleep(cap_waitq_handle_t whandle, uintptr_t timeout)
     150sys_errno_t sys_waitq_sleep(cap_waitq_handle_t whandle, uint32_t timeout,
     151    unsigned int flags)
    149152{
    150153        kobject_t *kobj = kobject_get(TASK, whandle, KOBJECT_TYPE_WAITQ);
     
    157160
    158161        errno_t rc = waitq_sleep_timeout(kobj->waitq, timeout,
    159             SYNCH_FLAGS_INTERRUPTIBLE | SYNCH_FLAGS_FUTEX, NULL);
     162            SYNCH_FLAGS_INTERRUPTIBLE | flags, NULL);
    160163
    161164#ifdef CONFIG_UDEBUG
Note: See TracChangeset for help on using the changeset viewer.