[SOLVED] CS代考计算机代写 #ifndef LOCK_H

30 $

File Name: CS代考计算机代写_#ifndef_LOCK_H.zip
File Size: 357.96 KB

SKU: 3175212763 Category: Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Or Upload Your Assignment Here:


#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
30 $