Changeset 203f4c3 in mainline for generic/include


Ignore:
Timestamp:
2006-04-09T14:14:49Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
016acbe
Parents:
fe04594
Message:

Sleeping in a wait queue can be now interrupted with
waitq_interrupt_sleep().

Location:
generic/include
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • generic/include/proc/thread.h

    rfe04594 r203f4c3  
    8181        void *thread_arg;                       /**< Argument passed to thread_code() function. */
    8282
    83         context_t saved_context;                /**< From here, the stored context is restored when the thread is scheduled. */
    84         context_t sleep_timeout_context;        /**< From here, the stored failover context is restored when sleep times out. */
     83        /** From here, the stored context is restored when the thread is scheduled. */
     84        context_t saved_context;
     85        /** From here, the stored timeout context is restored when sleep times out. */
     86        context_t sleep_timeout_context;
     87        /** From here, the stored interruption context is restored when sleep is interrupted. */
     88        context_t sleep_interruption_context;
    8589
    8690        waitq_t *sleep_queue;                   /**< Wait queue in which this thread sleeps. */
  • generic/include/synch/synch.h

    rfe04594 r203f4c3  
    3636#define ESYNCH_WOULD_BLOCK      1       /**< Could not satisfy the request without going to sleep. */
    3737#define ESYNCH_TIMEOUT          2       /**< Timeout occurred. */
    38 #define ESYNCH_OK_ATOMIC        4       /**< Operation succeeded without sleeping. */
    39 #define ESYNCH_OK_BLOCKED       8       /**< Operation succeeded and did sleep. */
     38#define ESYNCH_INTERRUPTED      4       /**< Sleep was interrupted. */
     39#define ESYNCH_OK_ATOMIC        8       /**< Operation succeeded without sleeping. */
     40#define ESYNCH_OK_BLOCKED       16      /**< Operation succeeded and did sleep. */
    4041
    41 #define SYNCH_FAILED(rc)        ((rc) & (ESYNCH_WOULD_BLOCK | ESYNCH_TIMEOUT))
     42#define SYNCH_FAILED(rc)        ((rc) & (ESYNCH_WOULD_BLOCK | ESYNCH_TIMEOUT | ESYNCH_INTERRUPTED))
    4243#define SYNCH_OK(rc)            ((rc) & (ESYNCH_OK_ATOMIC | ESYNCH_OK_BLOCKED))
    4344
  • generic/include/synch/waitq.h

    rfe04594 r203f4c3  
    5555        waitq_sleep_timeout((wq),SYNCH_NO_TIMEOUT,SYNCH_BLOCKING)
    5656
    57 extern void waitq_interrupted_sleep(void *data);
    58 
    5957extern void waitq_initialize(waitq_t *wq);
    6058extern int waitq_sleep_timeout(waitq_t *wq, __u32 usec, int nonblocking);
    6159extern void waitq_wakeup(waitq_t *wq, bool all);
    6260extern void _waitq_wakeup_unsafe(waitq_t *wq, bool all);
     61extern void waitq_interrupt_sleep(thread_t *t);
    6362
    6463#endif
Note: See TracChangeset for help on using the changeset viewer.