1
1
/*
2
- * Copyright (c) 2000, 2020 , Oracle and/or its affiliates.
2
+ * Copyright (c) 2000, 2024 , Oracle and/or its affiliates.
3
3
*
4
4
* Licensed under the Universal Permissive License v 1.0 as shown at
5
- * http ://oss.oracle.com/licenses/upl.
5
+ * https ://oss.oracle.com/licenses/upl.
6
6
*/
7
7
#ifndef COH_WINDOWS_CONDITION_HPP
8
8
#define COH_WINDOWS_CONDITION_HPP
@@ -28,7 +28,7 @@ using namespace coherence::native;
28
28
* Windows implementation of Condition.
29
29
*
30
30
* This implementation utilizes Windows Events which are not subject to the
31
- * suprious wakeup problem. This implementation however can produce spurious
31
+ * spurious wakeup problem. This implementation however can produce spurious
32
32
* wakeups, and users of Condition must account for them.
33
33
*
34
34
* @author 2007.12.10 mf
@@ -54,7 +54,7 @@ class COH_EXPORT WindowsCondition
54
54
COH_ENSURE (m_eventEnd != NULL );
55
55
56
56
// TODO - REMOVE THIS STATEMENT
57
- // test if it is an error to reset a unsignaled event
57
+ // test if it is an error to reset an unsignaled event
58
58
// if it is we need to adjust some code
59
59
COH_ENSURE (ResetEvent (m_eventBegin) != FALSE );
60
60
}
@@ -101,7 +101,7 @@ class COH_EXPORT WindowsCondition
101
101
<< nResult);
102
102
}
103
103
104
- // Note: cleanup order intetionally identical to acquistion order
104
+ // Note: cleanup order intentionally identical to acquisition order
105
105
if (atomicWaiters.adjust (-1 ) == m_cAllowed)
106
106
{
107
107
// all remaining threads are allowed to remain sleeping
@@ -144,7 +144,7 @@ class COH_EXPORT WindowsCondition
144
144
/* *
145
145
* Notify a specific number of threads.
146
146
*
147
- * @param cThreads the nubmer of threads to notify
147
+ * @param cThreads the number of threads to notify
148
148
*/
149
149
void notify (bool fNotifyAll )
150
150
{
@@ -171,24 +171,24 @@ class COH_EXPORT WindowsCondition
171
171
// open by a thread timing out
172
172
COH_ENSURE (ResetEvent (eventEnd) != FALSE );
173
173
174
- // ensure that no thread timesout between these two lines
174
+ // ensure that no thread timed out between these two lines
175
175
m_cAllowed = fNotifyAll ? 0 : cWaiters - 1 ;
176
176
int32_t cCurr = atomicWaiters.get ();
177
177
178
- // validate that no thread timedout
178
+ // validate that no thread timed out
179
179
if (cCurr == cWaiters)
180
180
{
181
- // no threads timedout
181
+ // no threads timed out
182
182
break ;
183
183
}
184
184
else if (cCurr == 0 )
185
185
{
186
- // all waiting threads timedout
186
+ // all waiting threads timed out
187
187
return ;
188
188
}
189
189
else if (cCurr < cWaiters)
190
190
{
191
- // some but not all waiting threads timedout
191
+ // some but not all waiting threads timed out
192
192
// try again
193
193
cWaiters = cCurr;
194
194
}
@@ -209,7 +209,7 @@ class COH_EXPORT WindowsCondition
209
209
WAIT_OBJECT_0);
210
210
211
211
// though likely already reset by the last thread to wake up
212
- // there is a slight chance that all threads timedout just
212
+ // there is a slight chance that all threads timed out just
213
213
// before we did SetEvent, in which case they could have call
214
214
// ResetEvent before we did our SetEvent, and we want to ensure
215
215
// we leave the Event reset
0 commit comments