🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #19268

Problem with static synchronized methods

#19268
From: Frank Febbraro
Date: Sat, 21 Feb 1998 00:00
31 lines
1258 bytes
I have a class that extends Thread.

In this class there a a few static methods that are used to put a
mutual exclusion lock on the class.

I have around 5 instances of this class.

Inside the first synchronized method if certain conditions do not
exist this thread is supposed to yield() to other threads waiting on
this class level lock.

Example:
         while(conditions are not met )
         {
              yield();
         }

The problem is that "yield()" never awakens the other blocked threads.
It gets stuck and executes this loop forever.

This worked on a AIX UNIX box, but on my home PC...no good.

Am I doing something wrong or if there a problem with thread on my PC
I have a Dell Dimension XPS 166 w/ 32 MB.

Can anyone offer help?

Thank you very much,

Frank Febbraro
Technical Details
Message-ID: <6cn593$b5f11@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,85d45b229917609,start
X-Google-Attributes: gidf74b3,public
From: "Frank Febbraro" <frank@sycamorehq.com>
Subject: Problem with static synchronized methods
Date: 1998/02/21
Message-ID: <6cn593$b5f11@forums.borland.com>
X-Deja-AN: 327309213
X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3
Organization: None
Newsgroups: borland.public.jbuilder.java.language