This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: WIN-06.1: win32-threads.cc


Adam Megacz wrote:

>2002-01-31  Adam Megacz
>
>        * win32-threads.cc:
>          - (_Jv_CondWait, _Jv_CondNotify, _Jv_CondNotifyAll) Corrected
>            wait() algorithm to make it safe.
>          - (ensure_condvar_initialized, _Jv_CondInit, _Jv_CondDestroy)
>            Added lazy creation of Win32 Events for better performance
>          - (really_start) This now uses GC_CreateThread so boehm-gc
>            knows about new threads even when statically linked.
>

Note quite formatted correctly - you should drop the "-"s and put colons 
after the method lists.

>! inline void ensure_condvar_initialized(_Jv_ConditionVariable_t *cv) {
>!   if (cv->ev[0] == 0) {
>

Formatting. Should have return type and modifiers on a different line, 
and "{"s on new line.

eg

inline void
ensure_condvar_initialized(...
{
  ...

>! int _Jv_CondWait(_Jv_ConditionVariable_t *cv, _Jv_Mutex_t *mu, jlong millis, jint nanos) {
>
....

>! 
>!   EnterCriticalSection(&cv->count_mutex);
>!   cv->blocked_count--;
>!   // if we were unblocked by the second event (the broadcast one) and nobody is left, reset the signal
>

You need to wrap long lines here, and comments should be full sentences.

The patch is approved, subject to formatting fixes.

regards

Bryce.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]