Motorola MCP750 Specifications Page 191

  • Download
  • Add to my manuals
  • Print
  • Page
    / 344
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 190
Multithreading a Device Drive
r
11-1
7
#include <sys/types.h>
#include <sys/ksynch.h>
#include <sys/ddi.h>
bool_t SLEEP_LOCKOWNED(lockp)
lock_t *lockp;
where:
lockp is a pointer to the sleep lock to be queried.
The SLEEP_LOCKOWNED routine returns TRUE (a non-zero value) if the lock is currently
held by the calling context or FALSE (zero) if the lock is not currently held by the calling
context.
To release a sleep lock, use the SLEEP_UNLOCK routine:
#include <sys/ksynch.h>
#include <sys/ddi.h>
void SLEEP_UNLOCK(lockp)
lock_t *lockp;
where:
lockp is a pointer to the sleep lock to be unlocked.
The SLEEP_UNLOCK routine has no return value.
Finally, to deallocate an instance of a sleep lock, use the SLEEP_DEALLOC routine:
#include <sys/ksynch.h>
#include <sys/ddi.h>
void SLEEP_DEALLOC(lockp)
lock_t *lockp;
where:
lockp is a pointer to the sleep lock to be deallocated.
The SLEEP_DEALLOC routine has no return value.
Sleep locks automatically support priority inheritance. This means that an LWP that suc-
cessfully locks a sleep lock executes at a priority at least as high as the priorities of all
LWPs blocked on the sleep lock. When unlocked, the locking LWPs priority is restored to
its original value. Priority inheritance is a means of preventing priority inversion which
could be a critical problem on real-time systems.
For additional information on the sleep lock interfaces, refer to the corresponding system
manual pages.
Page view 190
1 2 ... 186 187 188 189 190 191 192 193 194 195 196 ... 343 344

Comments to this Manuals

No comments