Threads not working together well  !

Dear People,
The following line of code gives an error message:
while(inTray.size() != 0)
The error message says:
current thread not owner, Exception in thread "main"
Thank you for your advice
Stan

Dear Dubwai,
Here is the entire output. (Except for entire list
t of credits and debits posted by the bank. )
Start debit of A//C No. 2 : $971 amount: 45
Start credit of A//C No. 1 : $624 amount: 71
End credit of A//C No. 1 : $695 amount: 71
java.lang.IllegalMonitorStateException: current thread
not owner
     at java.lang.Object.wait(Native Method)
     at java.lang.Object.wait(Object.java:426)
     at stan_ch15p638.Clerk.isBusy(Clerk.java:80)
at
stan_ch15p638.TryBankOperation.main(TryBankOperation.j
va:75)
End debit of A//C No. 2 : $926 amount: 45
Start debit of A//C No. 2 : $926 amount: 48
Exception in thread "main"
I would post the entire program but the last time I
did that
I received a negative response. The error message
speaks of
line 75 which is the line posted previously.No it isn't.
This is what you posted.
while(inTray.size() != 0)
In the above stack trace the following appears...
Clerk.isBusy...
That is where the problem occurs in your code.

Similar Messages

  • Worker does not work so well

    Hi everyone,
         I am trying to decrypt an encrypted video in my opne-source project SparrowPlayer(https://github.com/yatsen-yang/SparrowPlayer),and I found that decrypting the video may block the main thread for several seconds.It resulted in stopping renderring UI assets on the stage, which is unacceptable.So I think 'Worker' may do some help. I followed the example code of the online API about Worker(http://help.adobe.com/zh_CN/FlashPlatform/reference/actionscript/3/flash/system/Worker.htm l). I tested and it worked well.
         But I found that if I embed the BGWorker.swf in other class like com.xx.Test instead of in the document class, 'Worker' did not work so well.Sometimes main worker could not communicate with bgworker even that the state of bgworker is running.
    The example code followed:
        private function handleBGWorkerStateChange(event:Event):void
              if (bgWorker.state == WorkerState.RUNNING)
                      _statusText.text = "Background worker started";
                     bgWorkerCommandChannel.send(["startCount", 100000000]);
        It happened sometime, not everytime. If main worker send a message after 1 second when listerning that the state of bgworker is running, the code works well
        So it confused me. Logically, if the state of bgworker is running, it should mean that main worker can communicate with bgworker, and it works well if you embed the bgworker swf in the document class.But if you embed the bgworker swf in other class, you will have problem sometime.
        Finally, I found a solution.I embed the bgworker swf in other class instead of in the document class, and when bgworker initializes succesfully, it send a message to main worker.Main worker communicates withe bgworker immediately if it  receives the message coming from bgworker.Now the problem is solved.
        I want to know why the state of Worker not reliable when I embed the bgworker swf in other class.Is it a bug of Worker?   
        thanks

    We would need to debug it to definitively understand the problem.  I would recommend filing a bug with a simplified example that demonstrates the problem.  If you post the bug number here, I'll escalate it to the engineering team.
    Also, have you tried multiple browsers?  We can always do that triage here, but it would be an interesting data point.

  • Edege animate: Parallax and Spotlight = Not working together?...

    Hi all,
    This is my first post, and sorry for my English :))
    I am learning, and have a small composition on Edge Animate CC 2014 on Scrolling Parallax, which works very well, and now I want to add a spotlight... but do not working together.
    My code is:
    Stage: 1920 x 2000
    Autoplay: No
    -- creationComplete: (nothing)
    -- compositionReady:
    EC.Parallax.setup(sym);
    On scene:
    A Text (is for launch the spotlight with the click function):
    Action for "Text":
    -- click
    // Open image in spotlight overlay
    // Set up configuration
    var config = {
    width: "1024",
    height: "768",
    type: "image",
    source: "images/dog.jpg"
    EC.Spotlight.open( config );
    My problem is that the parallax works great, but when I make a click on the button that showing the spotlight... this is not released, and "dog.jpg" picture it is show on the bottom of the page (without spotlight).
    What am I doing wrong?
    Note: I charge via url the "All in One" of EdgeCommons CDN : http://cdn.edgecommons.org/an/1.1.2/js/min/EdgeCommons.js
    Many thanks!

    Ok. I've solved. I needed to load some things:
    EC.Parallax.setup (sym);
    The full code (that works for me) is:
    -- compositionReady:
    EC.Parallax.setup(sym);
    // Load Edge Commons
    yepnope({
    load: [
    "http://cdn.edgecommons.org/an/1.1.0/js/min/EdgeCommons.js",
    // Load style sheet for the overlay
    "http://cdn.edgecommons.org/an/1.1.0/css/style.css"
    -- click
    // Open image in spotlight overlay
    // Set up configuration
    var config = {
    width: "1024",
    height: "768",
    type: "image",
    source: "images/dog.jpg"
    EC.Spotlight.open( config );
    I hope to serve others.
    Regards

  • TS1702 How do I get a refund for an app that did not work/deliver well at all?

    How do I get a refund for an app that did not work/deliver well at all?

    You may not get a refund, but you can try contacting itunes support and asking.
    Click Support at the top of the page, then click the link under Contact Apple Support.

  • TS1538 red dot glowing on proximity sensor of my iphone 4 and it is dead. it is not connecting with itunes. tried hard reset it's not working as well. also followed iphone troubleshooting assistant but also it's not working. what am i supposed to do now?

    red dot glowing on proximity sensor of my iphone 4 and it is dead. it is not connecting with itunes. tried hard reset it's not working as well. also followed iphone troubleshooting assistant but also it's not working. what am i supposed to do now?

    Make an appointment at the Genius Bar at your local Apple Store or take the phone into an Authorized Apple Service provider.

  • Z3 bluetooth amd wifi not working together

    hello , the bluetooth and wifi is not working together, when streaming videos through wifi and audio is connected to the bluetooth outspeaker , wifi connection drops for 30seconds and re-connecting , Sony please fix this bug.. than this phone is good. till now. 

    Hi I had the same issue a Week back with my Sony Xperia Z3 compact -- Model # D5833. 
    An auto software update in lollipop and the Wifi and Bluetooth stopped working.
    After speaking the the customer service expert (on chat) --Xperia Support center--  initially he advised me1. To start the phone in a safe mode -- (press the power button for 3-4 secs you get the option) but that didnt help.2. Next he asked me to do a repair through Sony Companion which I had installed on my laptop --- did it --reinstalled the whole software after wiping the complete software including cache--but to no avail.3. Finally when he had no solutions left.. he asked  me to show it at the authorized Sony service center as it was under warranty.
    I followed his instructions as did not want to experiment with my 7 months old handset, went next day to the Sony authorized Service Centre India (Mumbai) (17th Aug'2015) they said its a software problem and needed a day to rectify. But when I called them the next day to check on my phone status, they shared its a hardware problem and have sent across to another center which will do the hardware repair and will take maximum a week.  So the week is going to end after a couple of days....I will keep you guys posted on the update. The suggestion which I would like to share is, if you are having a similar problem run and go to the authorized service centre and leave the rest to the experts, without experimenting yourself.
    So once I will receive my handset in a weeks time ....I will share you the status....on the exact issue with the device.

  • I keep getting a message that my ipad could not be activated because activation server is unavailable and when i try to use itune its not working as well.Plssss help

    i keep getting a message that my ipad could not be activated because activation server is unavailable and when i try to use itune its not working as well.Plssss help

    Has this iPad ever been jailbroken, had the OS rolled back, or used a beta version?

  • My new macbook air and new thunderbolt monitor will not work together. the keyboard will not engage and the monitor screen keeps going black. is it a problem with the monitor, connection, laptop?

    my new macbook air and new thunderbolt monitor will not work together. the keyboard will not engage and the monitor screen keeps going black. is it a problem with the monitor, connection, laptop?

    A new Mac comes with 90 days of free tech support from AppleCare.
    AppleCare: 1-800-275-2273
    Call AppleCare. They will help you.
    Best.

  • My mac won't restart, shut down, or go to sleep. And the volume and brightness does not work as well.

    My mac won't restart, shut down, or go to sleep. And the volume and brightness does not work as well.

    Connect the computer to the power.
    Hold the power button down for 10 seconds or more.
    Reset SMC.     http://support.apple.com/kb/HT3964
    Choose the method for:
    "Resetting SMC on portables with a battery you should not remove on your own".
    Best.

  • Hints FIRST_ROWS and order by not working together

    Hi,
    We are facing an issue like we are using hint FIRST_ROWS with a query which have a order by clause, if we are giving both together
    it is not working and if we remove either order by or hint it is working
    SELECT /*+FIRST_ROWS*/ * FROM (SELECT MYROWS.*,
    ROWNUM RN FROM (SELECT * FROM V_REPORT WHERE START_DATE > '22-SEP-04'
    AND END_DATE < '22-SEP-08' AND
    (GEO_ID in (select GEO_ID from loc where anc = 0))
    ORDER BY
    ENTITY,OPERATION,NAME
    MYROWS)
    A simliar query from other view is working fine.
    Please help me on the same.

    David_Aldridge wrote:
    Solomon Yakobson wrote:
    Well, ORDER BY implies all rows must be fetched first and then ordered. So yes, FIRST_ROWS does not make much sense in that situation, does it?.
    SY.Not in every case -- sometimes an index can be used by the optimizer to returen rows in the correct order without having identified the entire result set.
    FIRST_ROWS is deprecated in favour of FIRST_ROWS(n), by the way. http://download.oracle.com/docs/cd/B19306_01/server.102/b14223/usingpe.htm#i1009413
    And even if the result set needs to be ordered and no index can be used to avoid the sort operation Oracle offers for "top n" and "pagination" queries the "ORDER BY STOPKEY" optimization which only keeps the top n rows to sort (probably in memory if n is small enough) and eliminates the remaining ones which can make a huge difference if the volume to sort is large.
    I've written a note about issues like that recently.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • Threading not working on Mail 6.2 and 10.8. What to do?

    I'd love to use threading mails. But the feature is extremely flakey for me. E.g. I see three mails with identical subject, sent on the same day next to each other in the same folder.
    * I have Mail.app > Settings > View > View conversations: Include related messages (set to active)
    * Mail.app > Menu > View > Organize by Thread (set to active)
    This is very annoying, especially if you are an extensive mailing list addict and use many ticket systems. If then threading is not working - well your folders are a mess and you loose a lot of time trying to follow a single subject, scattered all over the place.
    :S
    Apple? Anything you can do, to improve this?

    For Mail.
    Do a backup.
    Take notes of all account information or take screen shots. You may need to set the accounts up again. Quit Mail.
    Copy the line below.
    ~/Library/Containers/com.apple.mail
    Select Go/Go To Folder from the Finder menu bar. Paste the line into the window. You won’t see it.
    Move the folder com.apple.mail to your desktop. You must move the entire folder, not just the contents.
    Relaunch Mail and test. If the problem is solved, recreate any required Mail settings and import any emails you want to save from the folder on the desktop. If the problem remains, return the folder to where you got it replacing the one that is there. 
    Information learned from Linc Davis.
    If you prefer to make your user library permanently visible, use the Terminal command found below.
    Show User Library Directory in Mac OS X 10.7 Lion & 10.8 Mountain Lion
    You might want to bookmark the command. I had to use it again after I installed 10.8.5. I have also been informed that if you drag the user library to Finder it will remain visible.

  • Java thread not working in windows 7

    I have a Java app that runs just fine on Windows XP. However, on Windows 7 there is a problem related to a job being done via a Java thread.
    Background: The app spawns a separate job via a Java thread and continues on while the spawned job executes. In other words, 2 things happen at once.
    Problem: On Windows 7, when the app spawns the job, Windows sits and waits for the spawned job to complete before it continues on. In other words, 2 things DO NOT happen at once.
    It's as if Java threading does not work in Windows 7. Any input would be greatly appreciated. Thanks.

    l_sleven wrote:
    Thanks for the input, guys. From now on I'll be sure to include a SSCCE.
    I'm beginning to believe this is actually my ignorance of threading in SWT, and XP was more forgiving than 7.
    I would include a SSCCE, but of the 4 different ways I tried to get this to work I wouldn't know which to include since all failed to fix the problem.
    If you want to identify a link to a web page identifying 'best practices' for SWT threading, that would be great. Be aware though that there's a good chance I've already googled the page.
    A programmer smarter than me once said, "The road to best practices is a bumpy ride".[Concurrency in Swing|http://download.oracle.com/javase/tutorial/uiswing/concurrency/index.html]

  • What do i do if my home button is not working very well if at all on my ipod touch 4g

    my home button has not been working very well if at all lately. it really buggs me because i have to use the little assistive touch thing, it gets kinda annoying after using that for awhile. now i know that you can take it off and replace it your self most likely ( i know you can on the iphones at least) i just dont want to risk screwing up my ipod. any help will be greatly appreciated.

    Try:
    http://snapguide.com/guides/calibrate-your-home-button/?utm_expid=69945963-15
    fix for Home button
    iPhone Home Button Not Working or Unresponsive? Try This Fix
    - you can turn on Assistive Touch it add the Home and other buttons to the iPods screen. Settings>General>Accessibility>Assistive Touch
    - If not under warranty Apple will exchange your iPod for a refurbished one for:
    Apple - Support - iPod - Repair pricing
    You can do it an an Apple store by:
    Apple Retail Store - Genius Bar
    or sent it in to Apple. See:
    Apple - Support - iPod - Service FAQ
    - There are third-party places like the following that will repair the Home button. Google for more.
      iPhone Repair, Service & Parts: iPod Touch, iPad, MacBook Pro Screens

  • Two CalType not working together

    Hi,
       I have one pricing procedure. I have created two 971 & 981 routines (CalType) as per my requirements. The issue is that both the routines are not working correctly if they are assigned together is the pricing procedure. But if I assign any one of them only then they work work together.
      I tried putting the Break-Point in both the routines and found that the control is passed to the first routine i.e 971 only and not 981 when it's corresponding condition type is entered.
      I have activated both the routines nad executed the report RV80HGEN also.
      Kindly advise a solution. Thanks

    duplicate question... please ignore

  • Adobe Audition does not work together with Audigy sound cards.

    Dear friends, pleasae, help. I use Adobe Audition sound processing program, my sound cars are of the Audigy line. Recording control does not work, a known bug, says Adobe. Play control works fine, but I'd like to make quality recordings. Something is not O.K.with the ASIO system, I figure. The case is the same with PCI as well as PCMCIA Audigy products.
    Tell me, please:
    -Is there a patch or workaround to fix this problem?
    -If not Audigy, what sound cards then?
    Getting help from Adobe isn't quite simple, but maybe, Audigy fans know better.
    [ordas]

    If you mean the recording source/level control in Surround Mixer (etc.) ... it is not working because of it's bypassed by the ASIO driver ... so, it's not a bug but normal behaviour. You just adjust the recording level in Audition (or in any other software). Normally you need to select
    - "AnalogMix()" input port option for analog line sources like Line-In, Audio CD, AUX-In, etc.
    - (Mix L and Mix R are equal w/ the famous "What U Hear" ...
    - S/PDIF for digital input
    - etc.. here are some reading on Creative Audigy ASIO matter -
    http://forums.creative.com/creativel...essage.id=1726
    Remember also set monitoring properly in software so you can hear what you're recording. This is normally set through a tiny 'speaker icon' found in every tracks header ('settings options').
    BTW, if you check the "Wave" source channel/slider when running in ASIO mode, you'll find out that it won't work either (it's all the same if you mute it). This is normal behaviour too, even when working in WDM/KS (Kernel streaming mode (or w/ Asio4All (which uses WDM/KS functionality))) ... it's just because of the kmixer is being bypassed ...
    jutapa
    Message Edited by jutapa on 12-14-200601:07 AM

Maybe you are looking for

  • Can't get past the first page of some websites

    4 days ago everything was working fine, then 2 days ago i bought something on ebay and followed the instructions to pay via paypal i didn't get any further than the check details page, so i closed and tried to go through the paypal site directly, the

  • Where is the file which stores the users and groups policies?

    Hi, as mentioned in the title..i would like to know which file stores the policies of the users and groups which i've defined. And where is this file stored? Thanks.

  • How to delete a PS network with status 'Technically Completed' (TECO)?

    Dear all, We have Webdynpro application, which will create a PS network in background. In the past it was working fine and many PS network  are created. Now we have a scenario where some of the networks which are with status 'Technically Completed' (

  • Question about displaying an image among columns in a report

    Hi folks, I've looked at examples that I've come across, but I guess I'm missing something. I have a PL/SQL procedure which returns a sql statement for a report. I want to display an image between two of the columns. I already have the images stored

  • How to export to desktop ?

    i can't find a desktop option,in 'export to' there are three options,all to do with folders but no option to export to desktop