Pretty sure that i am blowing past the notify() before the wait()

i am working on a project, and here is my basecase.
public class Worker extends Thread {
  public boolean taskFinished = false;
  private Object flag = new Object();
  private FutureTask task;
  public void run() {
    while(true) {
      synchronized(flag) {
        flag.wait();
        taskFinished = false;
        task.run();
        taskFinished = true;
  public void execute(FutureTask task) {
    synchronized(flag) {
      this.task = task;
      flag.notify();
}here is an example of how i'd use this class:
FutureTask ft = new FutureTask(task);
Worker worker = new Worker();
worker.start();
// Thread.sleep(10);  <-- this "fixes" the problem (well, makes the problem much less probable)
worker.execute(ft);
......without the wait(10) , the program works about 80% of the time.
with the wait(10) , my testing has always completed successfully. but that does not really solve the problem.
i am almost certain that i am calling flag.notify() before the flag.wait() ..... i have no idea of what to do.
note: this is probably a "non-standard" way to use FutureTask , and its more appropriate to use an ExecutorService to take care of this
business, but my problem is larger than this base case. i want to use this general structure. otherwise, i need to re-design.

When I visit at http://ezinearticles.com/?Acai-Berry---How-I-Lost-30-Pounds-in-Under-30-Days-Using-The-Acai-Berry&id=1998407 I found a product of acai berry to reduce weight. That one I try and find myself in good shape and I am happy to share this with all about acai berry.Acai Berry Weight Loss Program free!

Similar Messages

  • I have signed to up to iCloud and am pretty sure that all of my settings are turned on appropriately. However I get syncing from iCloud to my Mac and to my iPhone, but I am unable to get my iPhone to sync with the iCloud and most obviously calendar events

    I have signed to up to iCloud and am pretty sure that all of my settings are turned on appropriately. However I get syncing from iCloud to my iMac and to my iPhone, but I am unable to get my iPhone to sync with the iCloud and most obviously calendar events, so that if adding an event on my iPone it never appears on my other hardware? Can anyone help me sort this out?

    Re: check that the appointments in my phone are going into iCloud calendars....exactly how do I do this?  I fear this is a really stupid question!
    My iCloud account is set up with my Apple ID as one email account (for example [email protected]) which is the email account I use to sign up for internet sites like Amazon, Apple,etc, so that I can differentiate vendors/mass emails.  But my default calendar on my iPhone is in a different email name (ie [email protected]) which I use for most communications to friends, relatives, etc. and it is this account that holds most of my appointments.  To further complicate things I have other email accounts that I use for business/professional and community work.  If I want all my calendars to show on my iPhone AND sync to my iCloud, do I set this at the phone level or the iCloud level?  or both?   
    Let me clarify....It looks like if I go into appointments that I previously set up through my personal account (ie above [email protected]) and edit the entry on my iPhone, selecting the iCloud "home" calendar within the entry, it will then sync to my iCloud account, no problem....do I have to do this to EVERY entry I have? or is there  a way to name my personal account as one to sync to iCloud?

  • Ok so I cant open my Itunes due to Windows Error 2 and the message says to uninstall and re-install Itunes but I'm pretty sure that would wipe the library right? Is there any way to fix the problem and keep my library?

    Ok so I cant open my Itunes due to Windows Error 2 and the message says to uninstall and re-install Itunes but I'm pretty sure that would wipe the library right? Is there any way to fix the problem and keep my library?

    Hi neffn!
    I have an article for you that can help you go through that process of uninstalling and reinstalling iTunes. If you have Windows 7, you will want to see this article:
    Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7
    http://support.apple.com/kb/ht1923
    and if you are using Windows XP, you will want to reference this article:
    Removing and Reinstalling iTunes, QuickTime, and other software components for Windows XP
    http://support.apple.com/kb/ht1925
    Note that, as it says in those articles:
    iTunes Store purchases or songs imported from CDs are saved in your My Music folder by default and are not deleted by removing iTunes. While it is highly unlikely that you will lose any contents of your iTunes Library when following these steps, it is always a good idea to ensure that your iTunes library is backed up. If you're unsure how to backup, see iTunes: Back up your iTunes library by copying to an external hard drive.
    Thanks for using the Apple Support Communities. Have a good one!
    -Braden

  • HT201441 what if i cant reach the previous owner of the iphone coz i just bought it on a buy, swap and sell site? i tried to contact the seller several times but the number he is using is not active anymore. im pretty sure that the phone is not stolen

    hello there peeps, i cant use the iphone that i bought from a local buy, swap and sell site. the phone was restored to factory setting and i used it for 4 months but after that a message appeared and said that this phone has been lost. i tried to restore it again but i need the previous owner's apple id and password.
    i tried to contact him but i cannot reach him already, i tried reaching him on the sell site's page but still no response. i am pretty sure that the phone is not stolen coz i was present when he restore it to its factory setting. i just wanna ask you people what else can i do with it to be activated again, i paid $200 for this iphone 4 and dont just want it to go down to the drain. PLEASE HELP.. thank you

    onyok13 wrote:
    ... i cant use the iphone that i bought from a local buy, swap and sell site.... i just wanna ask you people what else can i do with it to be activated again,
    The Apple ID and Password that was Originally used to Activate the iDevice is required
    If you do not have that information you will not be able to use the Device.
    Activation Lock in iOS 7  >  http://support.apple.com/kb/HT5818

  • TS3694 hi i have a i phone 3 that wont turn on past the apple sign any one know off a progagram to reset it

    i have a i phone 3 that wont start up past the apple logo can u help cheers

    Locked Out, Forgot Lock or Restrictions Passcode, or Need to Restore Your Device: Several Alternative Solutions
    1. iOS- Forgotten passcode or device disabled after entering wrong passcode
    2. iPhone, iPad, iPod touch: Wrong passcode results in red disabled screen
    3. Restoring iPod touch after forgotten passcode
    4. What to Do If You've Forgotten Your iPhone's Passcode
    5. iOS- Understanding passcodes
    6. iTunes 10 for Mac- Update and restore software on iPod, iPhone, or iPad
    Forgotten Restrictions Passcode Help
    You will need to restore your device as New to remove a Restrictions passcode. Go through the normal process to restore your device, but when you see the options to restore as New or from a backup, be sure to choose New.
    Also, see iTunes- Restoring iOS software.

  • When extending my wifi network using an Extreme as my main and an Express to extend.. does it help to make sure that both devices are on the same channel or does it even make a difference if they are on different channels?

    when extending my wifi network using an Extreme as my main and an Express to extend.. does it help to make sure that both devices are on the same channel or does it even make a difference if they are on different channels?

    Have you even tried the process in which i have described in my previous post?
    Yes, many times.  If you are setup to "extend a wireless network, the screen looks like this:
    If you click the Wireless Options button, the screen looks like this:
    Where is it on this screen that you see a setting to adjust the channel?  It sounds like you are confusing "create a wireless network"....which does allow you to adjust channels.....with "exend a wireless network" which does not.
    Normally, when you extend a wireless network, AirPort Utility used to always assign the same channel to the extending device. That is no longer the case. It might be the same, or it might be different.  You have no control over this, so you have to accept what AirPort Utility thinks is best.

  • HT3576 Only receiving notifications to my iPhone but not to my iPad. Pretty sure they are both set up the same. Any suggestions welcome.

    Only receiving notifications to my iPhone but not to my iPad. Pretty sure they are both set up the same. Any suggestions welcome.

    Open the Settings app on teh iPad, go to Notifications and check to see what you have set up.
    Make sure Do Not Disturb isn't set to On.

  • How do i get my iphone 6 plus past the "Waiting for changes to be applied" in itunes.Not syncing music.

    I am having trouble with step 5 of syncing. It cant get past the "Waiting for changes to be made" part of the syncing process. Then if I eject the music is not on there. Help?

    Go to your App Store and see if you have an App that is in the process of updating or for some other reason in-progress.  Check your iTunes for something that is in-progress. 

  • I got this message after trying to download a movie: an unknown error occured (-50). please check that the connection to the network is active and try again. I'm pretty sure that my internet is connected, especially since I downloaded a song before that.

    Like I said, I'm pretty sure my internet is connected as I just downloaded a song right before I tried to download the movie. The extras for the movie downloaded by the way, but not the actual movie. Any ideas?

    Perhaps try the "Error -50," "-5000," "8003," "8008," or "-42023" section in the Specific Conditions and Alert Messages: (Mac OS X / Windows) section of the following document:
    iTunes: Advanced iTunes Store troubleshooting

  • I have a valid copy of Premiere Elements 11 that does not open past the Elements 11 Organizer Adobe Software License Agreement

    My copy of Premiere Elements 11 will not open. I'm on a PC with System 7. When I double-click on the PE11 desktop icon, the window opens that says Elements 11 Organizer Adobe Software License Agreement. I select English (North America) and "Accept". The window disappears but then reappears again and again. I have tried uninstalling and reinstalling from the disk and from the download. I have also tried a clean boot and have restarted numerous times. It accepts my Serial Number OK, but I can't seem to get beyond this step. Any help would be appreciated.

    stechasingleton
    Consider uninstall, free ccleaner run through (regular cleaner and registry cleaner parts), reinstall with antivirus and firewalls disabled.
    CCleaner - PC Optimization and Cleaning - Free Download
    Significantly different from what you did already?
    Have you looked at the antivirus interference in this?
    Even after the uninstall/reinstall, you might explore deleting the Adobe Premiere Elements Prefs file, and, if that does not work, then
    the whole 11 Folder in which it exists.
    Local Disc C
    Users
    Owner
    AppData
    Roaming
    Adobe
    Premiere Elements
    11.0
    and, in the 11.0 Folder, is the Adobe Premiere Elements Prefs file that you delete. If that does not work, then you delete the whole 11.0
    Folder in which it exists. Be sure to be working with Folder Option Show Hidden Files, Folders, and Drives active so that you can see
    the complete path cited.
    I have not seen that Organizer Adobe Software Licensing Agreement issue before and it does not quite fit in with the usual troubleshooting
    drill. But the above is worth the try to rule in or out.
    We will be watching for your progress.
    Thank you.
    ATR

  • TS1702 My apps haven't gotten past the "waiting" stage. What do I do?

    I recently went to the App Store to update some apps. After selecting to update, usually the app says "waiting" and eventually updates. This time none of the selected apps are updating and seem to be frozen in the "waiting" stage. What can I do to fix this problem?

    Does the iPod connect to other networks?
    Does the iPod see the network?
    Any error messages?
    Do other devices now connect?
    Did the iPod connect before?
    Try the following to rule out a software problem:                 
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Power off and then back on the router
    - Reset network settings: Settings>General>Reset>Reset Network Settings
    - iOS: Troubleshooting Wi-Fi networks and connections
    - iOS: Recommended settings for Wi-Fi routers and access points
    - Restore from backup. See:
    iOS: How to back up
    - Restore to factory settings/new iOS device.
    If still problem make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem.
    Apple Retail Store - Genius Bar

  • How do you erase and reinstall a hard drive without a disc? I bought this mac book pro under a year ago and am pretty sure i downloaded mountain lion from the app store. Basically Im having startup issues and this is the final step Ive reached

    when I start my laptop it loads a third of the way and shuts down automaticallyI've tried to safe boot, repairing discs and clearing RAM but nothing has worked. basically I've come to the final step of having to a erase my hard drive and reinstall mountain lion however Apple support suggest that I install from a disc however I installed mountain lion from the App Store. can anyone help me go about this?

    Install or Reinstall Lion/Mountain Lion from Scratch
    Be sure you backup your files to an external drive or second internal drive because the following procedure will remove everything from the hard drive.
    Boot to the Recovery HD:
    Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    Erase the hard drive:
      1. Select Disk Utility from the main menu and click on the Continue button.
      2. After DU loads select your startup volume (usually Macintosh HD) from the
          left side list. Click on the Erase tab in the DU main window.
      3. Set the format type to Mac OS Extended (Journaled.) Optionally, click on
            the Security button and set the Zero Data option to one-pass. Click on
          the Erase button and wait until the process has completed.
      4. Quit DU and return to the main menu.
    Reinstall Lion: Select Reinstall Lion/Mountain Lion and click on the Install button.
    Note: You will need an active Internet connection. I suggest using Ethernet if possible
                because it is three times faster than wireless.

  • Pretty sure that I need to at least reformat - how to backup?

    Hey guys,
    Ran into a very serious problem with my MBP today... was not doing anything particularly abnormal, and the laptop froze up and I had to do a hard reset. After that, subsequent start ups got stuck at the grey screen with Apple logo and spinning wheel.
    I tried single-user startup and verbose, both had error "cannot mount root, errno = 19".
    I booted from Mac OSX Snow Leopard CPU Drop-in DVD, tried disk utility verify, told me to repair. Tried disk utility repair, told me it could not be repaired and I should backup files and do a reformat.
    Tried Archive Install, could not find the harddrive so I could not select where to perform the install.
    There are a large number of files that I would like to backup... how do I go about doing this?
    Can anyone let me know which of the below are possible and which aren't?:
    1. Can I backup files + fix my MBP myself?
    2. Can I backup files and take it to the genius bar to get repaired?
    3. Can I do nothing further and now have to take it to the genius bar to perform a backup + get repaired?
    4. Are all of my files no longer retrievable and I must perform a reformat?
    Thanks alot... it's a shame that this has happened because I have literally not had any other problems with my MBP.
    Let me know!
    - Jesse
    Message was edited by: Jesse_Lim

    Can I backup files + fix my MBP myself?
    Not without an alternate Mac OS X installation for the backup and a program such as DiskWarrior for the repair, unless you just erase the drive. Some software may be able to get at the data without repairing the drive, but you need an alternate system besides that on the install DVDs to use it.
    Can I backup files and take it to the genius bar to get repaired?
    See above. The only difference between you and them in this case is availability of the components.
    Can I do nothing further and now have to take it to the genius bar to perform a backup + get repaired?
    See above.
    Are all of my files no longer retrievable and I must perform a reformat?
    Not enough information is available to answer this.
    (57254)

  • I have been getting messages from Safari when I am on commercial sites where I am sure that I have typed in the address correctly.  Messages say that the website was signed by an unknown certifying authority and my personal information may be at risk.  Th

    Am getting daily messages from Safari warning me that I am on a website with an unknow certifying authority and my personal information may be at risk.
    Happens when in Cox webmail and when I am visitying a legitimate site, and I have typed in address correctly such as Citibank rewards site.
    Have 3 choices, "Show Certficate" "Cancel" or "Continue". Screen is frozen and cannot exit Safari without acknowledging the message or clicking escape. I had been clicking continue, but after a month or more of many such messages decided to ask Cox.  They say it is a virus.  Was I careless in clicking continue?  What do many messages like this mean?  they can't all be unknown certifying authorities can they?

    Take each of the following steps that you haven't already tried. Stop when the problem is resolved.
    1. Are the current date (including the year) and time shown on your system clock? If not, correct them and test.
    2. Check that the following files exist:
    /System/Library/Keychains/SystemCACertificates.keychain
    /System/Library/Keychains/SystemRootCertificates.keychain
    If they don't, restore them from a backup or reinstall OS X after backing up all data.
    3. Disable any third-party firewall, "security" software, or network filter. Test.
    4. In some versions of OS X, Parental Controls has a bug that prevents loading of secure websites. Turn it off.
    5. The process by which OS X checks the validity of root SSL certificates doesn't work behind the authenticating SOCKS proxies used on some enterprise networks. If applicable, contact your network administrator. The proxy server may need to have its settings changed.
    6. Launch the Activity Monitor application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Activity Monitor in the icon grid.
    Select All Processes from the menu in the toolbar of the Activity Monitor window, if not already selected. Enter "ocspd" (without the quotes) in the "Filter" text field. Is a process with that name listed?
    If not, back up all data, then select
    Go ▹ Go to Folder
    from the Finder menu bar. Into the text box that opens, copy the following line of text:
    /var/db/crls
    From the folder that opens, move these two files to the Trash:
    crlcache.db
    ocspcache.db
    You’ll be prompted for your administrator password. Reboot, empty the Trash, and test.

  • MacBook Pro model A1150 that won't boot past the gray screen.

    I have tried to boot in Safe and Single User modes with no luck. I just need this to boot one more time so I can get my class notes off of it. Any Suggestions? It has Snow Leopard on it but I no longer have the installation disc and I do not have a FireWire that will fit into it.

    If you cannot get the MBP to boot, then it is a Firewire (assuming it will power up and can be put into Target Disk Mode) or an enclosure.  Those are the only two choices you have.
    Ciao.

Maybe you are looking for

  • My computer wont let me have bought songs on my iPod

    Before i was able to have bought songs be synced but now it wont let me have my songs on my iPod. When i press "sync" it responds "some of the songs in your iTunes libary, including 'When i grow up' were not copied onto the iPod 'Meghan's iPod' becau

  • OBIEE 11g online RPD change - do you have to restart servers

    Hi, After making ONLINE RPD changes in OBIEE 11G, do I still have to restart services from Enterprise manager? Thanks for your time and help.

  • I have lost my ipad how do i get it?

    what should i do?

  • CalcCache settings

    Hi Experts, I have recently set up a new system 9 environment (9.3.1). I currently have 2 servers 1 blade 64bit with 1tb of space and 32gb ram this is for our production essbase server, and 1 32bit with 500gb disk and 8gb of ram for our shared servic

  • MacBook Pro retina trackpad not working

    I purchased a MacBook pro with retina display two days ago and today the trackpad is not working. The mouse will not move or click. Everything else appears to be working correctly. I am using the 15" model if that makes any difference. Please let me