[SOLVED] CS #ifndef LOCK_H

$25

File Name: CS_#ifndef_LOCK_H.zip
File Size: 160.14 KB

5/5 - (1 vote)

#ifndef LOCK_H
#define LOCK_H

#include threads/semaphore.h

/* Lock */
struct lock {
struct thread *holder; /* Thread holding lock (for debugging) */
struct semaphore semaphore; /* Binary semaphore controlling access */
};

void lock_init(struct lock *);
void lock_acquire(struct lock *);
bool lock_try_acquire(struct lock *);
void lock_release(struct lock *);
bool lock_held_by_current_thread(const struct lock *);

#endif /* UCSC CSE130 */

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] CS #ifndef LOCK_H
$25