[spelling] signalling --> signaling (#162)

Switch from the UK spelling of signalling (also, signalled and
signaller) to the American spelling.
This commit is contained in:
John Grossman
2016-09-07 15:29:56 -07:00
committed by Travis Geiselbrecht
parent 71792d0d25
commit 0c782aa381
5 changed files with 28 additions and 28 deletions

View File

@@ -242,15 +242,15 @@ int mutex_test(void)
static event_t e;
static int event_signaller(void *arg)
static int event_signaler(void *arg)
{
printf("event signaller pausing\n");
printf("event signaler pausing\n");
thread_sleep(1000);
// for (;;) {
printf("signalling event\n");
printf("signaling event\n");
event_signal(&e, true);
printf("done signalling event\n");
printf("done signaling event\n");
thread_yield();
// }
@@ -287,9 +287,9 @@ void event_test(void)
printf("event tests starting\n");
/* make sure signalling the event wakes up all the threads */
/* make sure signaling the event wakes up all the threads */
event_init(&e, false, 0);
threads[0] = thread_create("event signaller", &event_signaller, NULL, DEFAULT_PRIORITY, DEFAULT_STACK_SIZE);
threads[0] = thread_create("event signaler", &event_signaler, NULL, DEFAULT_PRIORITY, DEFAULT_STACK_SIZE);
threads[1] = thread_create("event waiter 0", &event_waiter, (void *)2, DEFAULT_PRIORITY, DEFAULT_STACK_SIZE);
threads[2] = thread_create("event waiter 1", &event_waiter, (void *)2, DEFAULT_PRIORITY, DEFAULT_STACK_SIZE);
threads[3] = thread_create("event waiter 2", &event_waiter, (void *)2, DEFAULT_PRIORITY, DEFAULT_STACK_SIZE);
@@ -305,9 +305,9 @@ void event_test(void)
for (uint i = 0; i < countof(threads); i++)
thread_join(threads[i], NULL, INFINITE_TIME);
/* make sure signalling the event wakes up precisely one thread */
/* make sure signaling the event wakes up precisely one thread */
event_init(&e, false, EVENT_FLAG_AUTOUNSIGNAL);
threads[0] = thread_create("event signaller", &event_signaller, NULL, DEFAULT_PRIORITY, DEFAULT_STACK_SIZE);
threads[0] = thread_create("event signaler", &event_signaler, NULL, DEFAULT_PRIORITY, DEFAULT_STACK_SIZE);
threads[1] = thread_create("event waiter 0", &event_waiter, (void *)99, DEFAULT_PRIORITY, DEFAULT_STACK_SIZE);
threads[2] = thread_create("event waiter 1", &event_waiter, (void *)99, DEFAULT_PRIORITY, DEFAULT_STACK_SIZE);
threads[3] = thread_create("event waiter 2", &event_waiter, (void *)99, DEFAULT_PRIORITY, DEFAULT_STACK_SIZE);

View File

@@ -34,7 +34,7 @@ __BEGIN_CDECLS;
typedef struct event {
int magic;
bool signalled;
bool signaled;
uint flags;
wait_queue_t wait;
} event_t;
@@ -44,7 +44,7 @@ typedef struct event {
#define EVENT_INITIAL_VALUE(e, initial, _flags) \
{ \
.magic = EVENT_MAGIC, \
.signalled = initial, \
.signaled = initial, \
.flags = _flags, \
.wait = WAIT_QUEUE_INITIAL_VALUE((e).wait), \
}

View File

@@ -74,7 +74,7 @@ void event_destroy(event_t *e)
THREAD_LOCK(state);
e->magic = 0;
e->signalled = false;
e->signaled = false;
e->flags = 0;
wait_queue_destroy(&e->wait, true);
@@ -104,14 +104,14 @@ status_t event_wait_timeout(event_t *e, lk_time_t timeout)
THREAD_LOCK(state);
if (e->signalled) {
/* signalled, we're going to fall through */
if (e->signaled) {
/* signaled, we're going to fall through */
if (e->flags & EVENT_FLAG_AUTOUNSIGNAL) {
/* autounsignal flag lets one thread fall through before unsignalling */
e->signalled = false;
/* autounsignal flag lets one thread fall through before unsignaling */
e->signaled = false;
}
} else {
/* unsignalled, block here */
/* unsignaled, block here */
ret = wait_queue_block(&e->wait, timeout);
}
@@ -143,20 +143,20 @@ status_t event_signal(event_t *e, bool reschedule)
THREAD_LOCK(state);
if (!e->signalled) {
if (!e->signaled) {
if (e->flags & EVENT_FLAG_AUTOUNSIGNAL) {
/* try to release one thread and leave unsignalled if successful */
/* try to release one thread and leave unsignaled if successful */
if (wait_queue_wake_one(&e->wait, reschedule, NO_ERROR) <= 0) {
/*
* if we didn't actually find a thread to wake up, go to
* signalled state and let the next call to event_wait
* signaled state and let the next call to event_wait
* unsignal the event.
*/
e->signalled = true;
e->signaled = true;
}
} else {
/* release all threads and remain signalled */
e->signalled = true;
/* release all threads and remain signaled */
e->signaled = true;
wait_queue_wake_all(&e->wait, reschedule, NO_ERROR);
}
}
@@ -182,7 +182,7 @@ status_t event_unsignal(event_t *e)
{
DEBUG_ASSERT(e->magic == EVENT_MAGIC);
e->signalled = false;
e->signaled = false;
return NO_ERROR;
}

View File

@@ -104,7 +104,7 @@ size_t cbuf_peek(cbuf_t *cbuf, iovec_t *regions);
* supplied data.
* @param[in] len The maximum number of bytes to write to the cbuf.
* @param[in] canreschedule Rescheduling policy passed through to the internal
* event when signalling the event to indicate that there is now data in the
* event when signaling the event to indicate that there is now data in the
* buffer to be read.
*
* @return The number of bytes which were written (or skipped).

View File

@@ -52,8 +52,8 @@ void ti_cc_rfc_cpe_0_irq(void) {
// disable IRQ until thread handles and re-enables them in response to event
NVIC_DisableIRQ(rfc_cpe_0_IRQn);
// reschedule if we woke a thread (indicated by !signalled)
arm_cm_irq_exit(!cpe0_evt.signalled);
// reschedule if we woke a thread (indicated by !signaled)
arm_cm_irq_exit(!cpe0_evt.signaled);
}
static inline uint32_t cpe0_reason(void) {
@@ -76,8 +76,8 @@ void ti_cc_rfc_cmd_ack_irq(void) {
arm_cm_irq_entry();
HWREG(RFC_DBELL_BASE + RFC_DBELL_O_RFACKIFG) = 0;
event_signal(&ack_evt, false);
// reschedule if we woke a thread (indicated by !signalled)
arm_cm_irq_exit(!ack_evt.signalled);
// reschedule if we woke a thread (indicated by !signaled)
arm_cm_irq_exit(!ack_evt.signaled);
}
uint32_t radio_send_cmd(uint32_t cmd) {