/* Pushed by the CPU.
These are the interrupted task's saved registers. */
- void (*eip) (void); /* Current or next instruction. */
+ void (*eip) (void); /* Next instruction to execute. */
uint16_t cs, :16; /* Code segment for eip. */
uint32_t eflags; /* Saved CPU flags. */
void *esp; /* Saved stack pointer. */
}
/* Atomically releases LOCK and waits for COND to be signaled by
- some other piece of code. After COND is signalled, LOCK is
+ some other piece of code. After COND is signaled, LOCK is
reacquired before returning. LOCK must be held before calling
this function.
again.
A given condition variable is associated with only a single
- lock, but one lock may be be associated with any number of
+ lock, but one lock may be associated with any number of
condition variables. That is, there is a one-to-many mapping
from locks to condition variables.
struct list waiters; /* List of waiting threads. */
};
-void sema_init (struct semaphore *, unsigned value, const char *);
+void sema_init (struct semaphore *, unsigned value, const char *name);
void sema_down (struct semaphore *);
void sema_up (struct semaphore *);
const char *sema_name (const struct semaphore *);
struct semaphore semaphore; /* Binary semaphore controlling access. */
};
-void lock_init (struct lock *, const char *);
+void lock_init (struct lock *, const char *name);
void lock_acquire (struct lock *);
void lock_release (struct lock *);
bool lock_held_by_current_thread (const struct lock *);
struct list waiters; /* List of waiting threads. */
};
-void cond_init (struct condition *, const char *);
+void cond_init (struct condition *, const char *name);
void cond_wait (struct condition *, struct lock *);
void cond_signal (struct condition *, struct lock *);
void cond_broadcast (struct condition *, struct lock *);