My rumor thread.

If you want a Verizon Trophy, the best way to get one (maybe the only way)  is to drive around New Jersey behind delivery trucks.
Both the ebayclassified and craigslist Trophys seem to have fallen off trucks in Jersey
http://centralnj.ebayclassifieds.com/cell-phones/iselin/verizon-htc-trophy-7-windows-phone-new-global/?ad=11332864#ixzz1Md9jXEJS
http://newjersey.craigslist.org/mob/2372326619.html

Is there a possibility that imediately after the
share.getI()>0 and before
share.consumeI() another thread is
consuming I, so the variable goes to -1Yes, that could happen.
If i set getI to synchronized i get aroung this,
right?No, because even though get and consume are both synced, you still release the lock between get and consume. You'd need to modify your loop so that get and consume are inside a synchronized (share) block inside the loop body, or do the if test for i>0 inside consume.

Similar Messages

  • Outright USB bus power deterioration?

    2009 MacPro
    I'm so confounded and tired from this I'll just state the symptoms in bullet fashion
    • Powered Rosewill hub on one of the 3 rear USB ports: each of the 7 hub ports has been going out one after another the last 2 years. I just pull out a cable and move it to the next one.
    • Last couple years whimsical random ports not working (just switched to a dif. port)
    • With each upgrade (10.8, 10.9) thought it would solve the problem but doesn't
    • Yosemite put me over the edge. I can't even keep 2 thumb drives in the ports for data transfer until one unmounts
    • Self powered Toshiba USB 3.0 drive oes pretty good on 27" LED display hub-port
    • Almost impossible to even boot with a key held down:Option for boot drive, PRAM zap, etc.
    • After CCC boot drive cloned to Toshiba for Yosemite prep, would not pick it up after 'Startup Disk' selected as such and restarted. Defaulted to internal normal boot
    • Haven't used the Superdrive in years, even replacement drives would almost never work.
    • Four 4tb internal 3.5's running over all 4 sleds perfectly on SATA power. Main boot drive/OS is on OWC DDS 256gb Accelsior on the PCIe slot
    I don't know how I'm supposed to run a hardware test seeing as the bootable you're supposed to launch from would not appear anyway.
    IF I knew grabbing a USB 3.0 PCIe card to pop into the rear would be a cheap workaround I would gladly do it! WOuld that run on a different power supply than the rest of the USB system, IF the current powering these ports is compromised in strength? But why would even powered ports be dropping out, such as the Cinema ports etc.
    Help!!
    Don't want to run this to the Genius Bar but if these symptoms can trigger a diagnosis from any of the experienced here it would help a lot
    THXXX 
    ps - maybe it's a simple circuit thing on the board? A module? The power supply internally?  What I do NOT want to hear is motherboard stuff...that would put this at a fix more expensive than the machine is worth!

    Just wanted to do a follow up on what I've learned. One tried and true card peeps will stand by on the Mac Rumors threads is the 4-port version of this 7 port I'm going to get:   http://www.inateck.com/inateck-kt7001-7-port-usb-3-0-pci-e-express-card/
    I'm doing this one primarily because it requires power and one of the useless Superdrive bays (one is a BluRay reader that functioned correctly for all of a week) can afford me that source. Even though some there said that they have a number of spinners running off the PCIe power, (4 port doesn't require additional juice) I still feel more comfortable attaching one with power. I can add their hubs too, one has an SD reader built right in! I'll mount the powered aluminum MacBook version right under my desk.
    The one thing though, I believe with all PCIe based 3.0 cards - when the Mac is put to sleep, the power stops and drives get disconnected. I don't think it's a terrible issue for me, since it will be taking a drive for backup purposes. I don't know if it's a USB 3.0 shortcoming or a PCIe thing. But my main boot is an OWC Accelsior SSD and it's on a PCIe card so I have to think it's more of a USB thing.
    All the other weird things with the clean install and upgrade are much smoother now. Only thing that makes me nuts is with every OS upgrade I can see a little more lag in Graphics power when it comes to Spaces switching!  512 is about hitting it. Looking at new ones I'm only seeing 3 or 4GB hitting the $240 range. I'd settle for a 1.5 for $100 but don't think I'll find one of those.
    With each boot the whole system is running smoother, Lightroom, entire CS6 suite, you name it.
    The 3rd party Lightning cables were spotty at best in sync capabilities for that and iPad. My original is stuck in my car head unit. With Yosemite forget it!
    Apple blackballed all cables NOT Apple. I borrowed a buddies and my iPad and iPhone read without any issues. "Trust" this computer and finally have all 3 in harmony.
    Finally, the USB drives keep dropping with gb's of transfers. 2 SanDisk Fit's can't transfer to each other.
    I've come to the conclusion that the cost of a motherboard and labor to install (IF it's the USB controller) I might as well get an identical 4,1 2009 2.66.
    and drop my 16tb of internal plus OWC SSD and 16gb RAM.  And just sell this one for a hundo less with the understanding that the USB is sketchy!
    Makes sense right?
    I'll play around with the Bluebery iMac key/mouse and nothing else later on, but I doubt it'll make a difference

  • Returning New Old 3.06 Ghz iMac For New New 3.06 Ghz iMac

    Well of course I could not wait any longer and pulled the trigger on the 3.06ghz machine last Tuesday. Yes, I know I know you all have me to thank for this week actually being the long awaited imac update Tuesday. Just call me Murphy. Or maybe you don't want to thank me from the looks of many unhappy campers posts flying about.
    But getting back on point I'm going to bring my nice new "old" baby back for the new new one with the 4 GB DDR3 RAM and the Nvidia GT130 - not to mention the 1 TB HDD vs my current 500 GB drive.
    My question is, should I wipe this machine clean? I've got some stuff on it but in all honesty held off on really dumping everything I have (did not put my windows os or stuff on it yet etc) in case there was an update within 14 days of my buying it. So it's safe and still pretty clean.
    Do I have to wipe this clean or can I trust Apple to simply re-image on it's way down the refurb line?
    Any help much appreciated. Here's to hoping I don't have to eat the 10% rsf and can swap for even price!

    Hmmm I don't know.... The more I research and the more bmarks and GPU Z screens that pop up, the more this "GT130" smells to me like an *NVIDIA GeForce 9800M GTS.* Which actually is a bit clock slower than the previous 3 ghz 8800GS - which is actually an 8800 GTS btw (clocked down a bit).
    None the less the 9800m is a decent enough card. It's certainly a good choice for efficiency as it reportedly runs 75Mhz max. But unless it's an oc'd Apple Special (and they very well could be - often are) it's not better than it's predecessor.
    Check out these links if you want to see some interesting test screens regarding the debate of what this "gt 130" card really is.
    Good Mac Rumors thread with GP/card id info screens here:
    http://forums.macrumors.com/showthread.php?p=7227503&posted=1#post7227503
    and Notebookcheck's info on the 9800M GTS here:
    http://www.notebookcheck.net/NVIDIA-GeForce-9800M-GTS.9918.0.html

  • 10.5.6 Has broke Online Banking Access

    Since I updated my Intel imac with this update I can no longer access my online banking with BB&T, this is a very large Southeast Bank, when I log in, it just brings me to another screen, to log in again, no error message, I called the bank and of coarse they told me it's my fault, I must of forgot my password, anyway I talked to their online tech support, and they did tell me that they are aware that the update for the mac has broken the access to their site with Safari, they said I either had to use Internet Explorer or Mozilla, due to the fact that their site is no longer supported by Safari, due to the latest mac update.
    http://www.bbt.com
    Note: I also posted this at another site, where others have posted about the same problem with other online banking websites, not just BB&T

    Yes, exactly the same problem here. Can't login to HSBC using Safari. Sometimes the HSBC site is just a scrambled mess becuase Safari doesn't load certain graphics and CSS style sheets.
    Also intermitant problems logging into these support forums and Amazon.co.uk.
    I've tried all of the advice given above. Even did an archive and install this morning, although I don't think Safari got reinstalled?
    I've contacted HSBC. I am going to post any response in this Mac Rumors thread:
    http://forums.macrumors.com/showthread.php?p=6774924#post6774924
    Apprantly customers of the bank FirstDirect (part of HSBC) are notified at login of problems with the Safari browser. The macrumors thread I've linked to above has a screen grab.

  • Why does iOS not work with Blogger threaded discussions?

    This has been an ongoing problem since they appeared, if you do anything in a comment entry block on a Blogger based blog threaded reply it will silently crash. No more text entry, no moving cursor, no cut or paste functions.  You ask at Blogger support, no one answers - why would they want to fix an iOS problem? You leave nots here and other forums, no input no replies.  It must be a WebKit issue insincere all browsers have the same issue, even Chrome, and it happens on iPhone or iPad.
    Must be a JavaScript incompatibility but is frustrating - I'm surely not the only one who wants to reply to Blogger based blogs via iOS - it's one of the biggest blog services.
    Anyone have any insight? Rumors? Hope?

    About 2 weeks ago I noticed that my timeline is all messed up. The entire site is laid out in a conveluted fashion. Firefox is fine. Maybe someone else is having this problem. Thanks for your response..

  • Why was my thread deleted about Australian app store price?

    I asked a simple question - why is Final Cut X $350 AUD ($370 USD) compared to the $300 USD price in the states?  My thread was deleted!

    From the Terms of Use (link at the bottom of every page, and what was listed when you signed up):
            Submissions
    Stay on topic. Apple Support Communities is here to help people use Apple products and technologies more effectively. Unless otherwise noted, do not add Submissions about nontechnical topics, including:
    Speculations or rumors about unannounced products.
    Discussions of Apple policies or procedures or speculation on Apple decisions.
    (my highlighting)
    And why this one will vanish as well. This is for users to help other users, not a place to vent.

  • Experience with Thick Driver - Problems with threads?

    Hi!
    I was wondering if anybody has experienced some problems
    in the past regarding the use of the JDBC thick client?
    There are some "rumors" in our department that (at least
    two years ago) the contents of threads got mixed up!
    Have you heard of such errors?
    We have to make a decision at the moment wether to use
    thin or thick client. We use Oracle 8.1.7. and a
    Websphere App Server 4.04.
    Any comments about the reliability of thick drivers?
    Thanks, any help is highly appreciated!
    Cheers,
    Steffen

    Hello Steffen,
    I have been using Oracle's JDBC Think Client for some time and havent faced any problems yet. Atleast, havent faced any problems related to Threads.
    Hope this helps.

  • Do moderators remove whole discussion threads?

    yesterday I read/replied to a post (in a forum I don't remember, alas) but it was regarding someone switching from windows and that he got banned for cussing or freaking out or something, but was back and gonna play nice, etc. - anyhow, that aside, some folks were trying to help 1) decipher his question(s) and 2) help him out.
    I posted a response, but can't find it (my response or the thread)
    reason I'd like to is one of the other responders posted a list of links to items that may help folks new to Macs.
    Anyhow, I had to leave and was gonna pick up on those links again today, but can't find my post (it was there, others had followed mine as well) - the whole thread/discussion seems to be gone.
    I'm just trying to track down that list of links to the resources one of the responders listed related to switching/using macs (I don't remember the names of the posters)
    Anyhow, am I missing something or is it possible the moderator(s) just removed the whole thread for some reason or another?

    Yes, when we feel it is necessary an entire topic will be removed. This is typically done when the topic is spam, a non-constructive rant, or nothing but wild rumor and speculation. We do not like to remove topics that may contain valuable information and prefer to edit or even lock, but it does happen.
    I checked and the topic you were looking for was removed by the staff.
    Eric W.

  • Deleted Threads?

    There was a Thread here titled: When will this come to FCP?
    The discussion touched on Features of other NLE's that would be excellent additions to FCP and gave insight to the FCP Studio workflow. Not only was this thread very well written and not the usual 'My NLE is better than yours'; it was also very informative.
    Today, when I went to read new responses, thoughts, & additions... the thread was gone. I was not locked, pinned, or otherwise closed... but deleted. As if it never existed.
    What gives?
    Does this mean someone violated the rules?
    Are we NOT supposed to mention or compare other Software features?
    I thought the Forums were a place where we as an FCP Community share Real-World knowledge. As we all know... the text book method does NOT always work. It's nice to know that the Forum exists as an alternate source for finding Working Solutions.
    I read the rules of posting. I hope I'm not out of line.
    Curious... has anyone ever been following a Thread in the Forums only to have it mysteriously disappear?

    Yes threads do mysteriously disappear. But the first red flag when I read your post is the subject line.
    "When will this come to FCP?"
    It indicates a desire to know when a not yet available feature is going to come. Subject lines like "When will XYZ happen" are inherantly dangerous to post because Terms of Use forbid:
    "Submissions
    1. Stay on topic. Apple Discussions is here to help people use Apple products and technologies more effectively. Unless otherwise noted, do not add Submissions about nontechnical topics, including:
    1. Speculations or rumors about unannounced products.
    2. Discussions of Apple policies or procedures or speculation on Apple decisions. "
    Therefore I think you were a victim of the subject line, even if the content of the thread was different.
    So even if the thread never actually promotes speculation in its content, a venturesome user might briefly read one post of your thread, and try to tempt to write in info they might have read in a rumor site about when such a feature might appear, or speculate such a feature.
    I suggest in the future when posting a thread about a currently available feature somewhere, make the subject line less provocative. I.e. Anybody know if Final Cut Pro has _this feature_ (substituting the feature name in place of this feature)?
    That's going to raise less eyebrows than "When will Final Cut Pro have this..."
    I don't work for the forum moderators. I just happen to know what looks suspicious. Neither do I tempt to guess their policy. I'm just saying what I think might have triggered their response. I could be wrong.

  • What happened to the thread?

    Why did the topic "Copy/Paste and Everything Wrong + 3 great moves" get deleted?
    I believe the topic raised some very reasonable concerns and suggestions about how to make the iPhone more viable in the corporate environment.
    One poster suggested Apple really listens to user suggestions. However the disappearance of that thread might suggest Apple might be stifling, rather than listening to any constructive criticism of the product.
    Why has that thread been removed?

    f this forum is intended as a forum for Apple users, why would Apple censor it, when there was no offensive or derogatory comments posted in the thread in question?
    Because it violated the TOU.
    From the TOU:
    Stay on topic. Apple Discussions is here to help people use Apple products and technologies more effectively. Unless otherwise noted, do not add Submissions about nontechnical topics, including:
    1. Speculations or rumors about unannounced products.
    2. Discussions of Apple policies or procedures or speculation on Apple decisions.
    From what I have observed, feature requests are considered speculation by the Hosts. You are describing something you would like to see in a future release of a hardware or software product, and not asking for or offering help about how to use an existing product. More importantly, the users on this forum can't help you with your request, because they are not Apple employees and have no ability to change the product in question. Those few Apple employees who might read your post are not permitted to discuss any future release, and are equally unable to help you.
    Quite simply, Apple Discussions are not the place for feature requests or speculation about future releases of software or hardware. A thread that is started with the intention of discussing such speculation will usually be deleted. If discussion of features - or their lack - arises in a proper thread (Ex: "How do I do this?" ans: "You can't, because..." or ans: "You can't, but here's a work around.") then the post is usually permitted to stand. Polling is also against the TOU, so starting a topic like "I wish (xx) had (this feature), what do you think?" is a double violation. (I didn't see your thread, I'm just describing a type of thread I often see getting deleted.) Apple feedback is the appropriate place to make feature requests. You can also find non-Apple managed rumor sites where this kind of speculation is encouraged.
    The purpose of Apple Discussions is to find (and offer) support using the product that you have, not for describing the product that you wish you had. Before posting, consider how likely the users here will be to answer and solve your question (or to benefit from your non-question topic). That's a good rule of thumb that can help you avoid having your topics removed.
    Regards.

  • A problem with threads

    I am trying to implement some kind of a server listening for requests. The listener part of the app, is a daemon thread that listens for connections and instantiates a handling daemon thread once it gets some. However, my problem is that i must be able to kill the listening thread at the user's will (say via a sto button). I have done this via the Sun's proposed way, by testing a boolean flag in the loop, which is set to false when i wish to kill the thread. The problem with this thing is the following...
    Once the thread starts excecuting, it will test the flag, find it true and enter the loop. At some point it will LOCK on the server socket waiting for connection. Unless some client actually connects, it will keep on listening indefinatelly whithought ever bothering to check for the flag again (no matter how many times you set the damn thing to false).
    My question is this: Is there any real, non-theoretical, applied way to stop thread in java safely?
    Thank you in advance,
    Lefty

    This was one solution from the socket programming forum, have you tried this??
    public Thread MyThread extends Thread{
         boolean active = true;          
         public void run(){
              ss.setSoTimeout(90);               
              while (active){                   
                   try{                       
                        serverSocket = ss.accept();
                   catch (SocketTimeoutException ste){
                   // do nothing                   
         // interrupt thread           
         public void deactivate(){               
              active = false;
              // you gotta sleep for a time longer than the               
              // accept() timeout to make sure that timeout is finished.               
              try{
                   sleep(91);               
              }catch (InterruptedException ie){            
              interrupt();
    }

  • Slight problem with threads....

    Hello,
    Just started learning threads a few days ago.. my objective is to move an oval from left to right, then right to left, back and forth and so on.. however, it wont work, the source code i have below seems logical, but it doesnt fulfill my objective..
    // The "MovingCircleUsingThreads" class.
    import java.applet.*;
    import java.awt.*;
    public class MovingCircleUsingThreads extends Applet implements Runnable
        int x = 0;
        Thread t;
        public void init ()
            t = new Thread (this);
            t.start ();
        } // init method
        public void run ()
            try
                while (true)
                    repaint ();
                    Thread.sleep (20);
            catch (Exception e)
        public void paint (Graphics g)
            int speed = 10;
            Dimension d = getSize ();
            g.fillOval (x, d.height / 4, 50, 50);
            x = x + speed;
            if (x + 50 == d.width)
                speed = -10;
    } // MovingCircleUsingThreads classI think the paint method is wrong, but it all seems logical.. x starts off in the left side, moves to the right side by 10, when x + 50 == d.width, the oval is at the right edge, and speed = -10, so it should be moving to the left by 10, but instead, the oval disappears.. :( can anyone help?
    public void paint (Graphics g)
            int speed = 10;
            Dimension d = getSize ();
            g.fillOval (x, d.height / 4, 50, 50);
            x = x + speed;
            if (x + 50 == d.width)
                speed = -10;
        }

    public void paint (Graphics g)
    int speed = 10;
    Dimension d = getSize ();
    g.fillOval (x, d.height / 4, 50, 50);
    x = x + speed;
    if (x + 50 == d.width)
    speed = -10;
    }So you are setting speed to -10, and then you are
    leaving paint?
    Can not see this having any impact on processing...Im setting speed to -10 because I want the oval to go left.... But it wont, after the oval goes from left to right, it disappears..
    Try changing the following:
    if (x + 50 == d.width)
    speed = -10;to
    if (x + 50 >= d.width)
    speed = -10;
    Tried changing that before, oval disappears after it goes to right side :\

  • A problem with Threads and loops.

    Hi, I have some code that needs to be constantly running, like while(true)
          //code here
    }However, the code just checks to see if the user has input anything (and then if the user has, it goes to do some other stuff) so I don't need it constantly running and hogging up 98% of the CPU. So I made my class (which has the method that needs to be looped, call it ClassA) implement Runnable. Then I just added the method which needed to be looped into the public void run()
    I have another class which creates an instance of the above class (call it ClassB), and the main(String[] args) is in there.
    public static void main(String[] args)
              ClassA test = new ClassA();
              Thread thread = new Thread(test.getInstanceOfClassA());
              thread.start();
              while(true)
                           //I do not know what to put here
                   try
                        thread.sleep(100);
                   catch(InterruptedException iex)
         }However, the thread only calls run() once,(duh...) but I can't think of away to get it to run - sleep - run -sleep forever. Can someone help me?

    Hi, I have some code that needs to be constantly
    running, like while(true)
    //code here
    }However, the code just checks to see if the user has
    input anything (and then if the user has, it goes to
    do some other stuff) so I don't need it constantly
    running and hogging up 98% of the CPU. Where does the user input come from. Are you reading from an InputStream? If so, then your loop will be blocked anyway when reading from the InputStream until data is available. During that time, the loop will not consume processor cycles.
    public static void main(String[] args)
              ClassA test = new ClassA();
    Thread thread = new Thread(test.getInstanceOfClassA());I have never seen this idiom. If ClassA instanceof Runnable, you simply write new Thread(test).
              thread.start();
              while(true)
    //I do not know what to put
    do not know what to put here
                   try
                        thread.sleep(100);
                   catch(InterruptedException iex)
         }However, the thread only calls run() once,(duh...)Yeah, why would you want to call it more than once given that you have an infinite loop in ClassA.run()?
    Harald.
    Java Text Crunching: http://www.ebi.ac.uk/Rebholz-srv/whatizit/software

  • A problem with Threads and MMapi

    I am tring to execute a class based on Game canvas.
    The problem begin when I try to Play both a MIDI tone and to run an infinit Thread loop.
    The MIDI tone "Stammers".
    How to over come the problem?
    Thanks in advance
    Kobi
    See Code example below:
    import java.io.IOException;
    import java.io.InputStream;
    import javax.microedition.lcdui.Graphics;
    import javax.microedition.lcdui.Image;
    import javax.microedition.lcdui.game.GameCanvas;
    import javax.microedition.media.Manager;
    import javax.microedition.media.MediaException;
    import javax.microedition.media.Player;
    public class MainScreenCanvas extends GameCanvas implements Runnable {
         private MainMIDlet parent;
         private boolean mTrucking = false;
         Image imgBackgound = null;
         int imgBackgoundX = 0, imgBackgoundY = 0;
         Player player;
         public MainScreenCanvas(MainMIDlet parent)
              super(true);
              this.parent = parent;
              try
                   imgBackgound = Image.createImage("/images/area03_bkg0.png");
                   imgBackgoundX = this.getWidth() - imgBackgound.getWidth();
                   imgBackgoundY = this.getHeight() - imgBackgound.getHeight();
              catch(Exception e)
                   System.out.println(e.getMessage());
          * starts thread
         public void start()
              mTrucking = true;
              Thread t = new Thread(this);
              t.start();
          * stops thread
         public void stop()
              mTrucking = false;
         public void play()
              try
                   InputStream is = getClass().getResourceAsStream("/sounds/scale.mid");
                   player = Manager.createPlayer(is, "audio/midi");
                   player.setLoopCount(-1);
                   player.prefetch();
                   player.start();
              catch(Exception e)
                   System.out.println(e.getMessage());
         public void run()
              Graphics g = getGraphics();
              play();
              while (true)
                   tick();
                   input();
                   render(g);
          * responsible for object movements
         private void tick()
          * response to key input
         private void input()
              int keyStates = getKeyStates();
              if ((keyStates & LEFT_PRESSED) != 0)
                   imgBackgoundX++;
                   if (imgBackgoundX > 0)
                        imgBackgoundX = 0;
              if ((keyStates & RIGHT_PRESSED) != 0)
                   imgBackgoundX--;
                   if (imgBackgoundX < this.getWidth() - imgBackgound.getWidth())
                        imgBackgoundX = this.getWidth() - imgBackgound.getWidth();
          * Responsible for the drawing
          * @param g
         private void render(Graphics g)
              g.drawImage(imgBackgound, imgBackgoundX, imgBackgoundY, Graphics.TOP | Graphics.LEFT);
              this.flushGraphics();
    }

    You can also try to provide a greater Priority to your player thread so that it gains the CPU time when ever it needs it and don't harm the playback.
    However a loop in a Thread and that to an infinite loop is one kind of very bad programming, 'cuz the loop eats up most of your CPU time which in turn adds up more delays of the execution of other tasks (just as in your case it is the playback). By witting codes bit efficiently and planning out the architectural execution flow of the app before start writing the code helps solve these kind of issues.
    You can go through [this simple tutorial|http://oreilly.com/catalog/expjava/excerpt/index.html] about Basics of Java and Threads to know more about threads.
    Regds,
    SD
    N.B. And yes there are more articles and tutorials available but much of them targets the Java SE / EE, but if you want to read them here is [another great one straight from SUN|http://java.sun.com/docs/books/tutorial/essential/concurrency/index.html] .
    Edited by: find_suvro@SDN on 7 Nov, 2008 12:00 PM

  • J2ME problem with threads

    Hi all,
    I would like to ask you for a help. I need to write a small program at my university. I started to write a midlet which function would be to countdown time for sports activities. I woul like to start a new thread - the one that counts down - and at the same time make the main thread sleep. After the "countdown" thread finishes, the main thread wakes up and waits for user input. The problem is that when the "countdown" thread finishes his work, I've got Uncaught exception java/lang/NullPointerException. error and the midlet halts.
    Below you can find the code
    import java.lang.*;
    import java.util.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.*;
    public class intervals extends MIDlet implements CommandListener
    public Display ekran;
    private SweepCanvas sweeper;
    private Form rundy;
    private TextField round0, round1, round2, round3, round4, round5, round6, round7, round8;
    private long czas,x;
    private Command exitCommand;
    private Command addRound;
    private Command delRound;
    private Command start;
    private TextField repeat;
    private Form odliczanie;
    private Alert ostrz;
    Licznik thread;
    String test;
    StringItem test1;
    int parz,i,j,k;
    static int l;
    int ilrund;
    int ilpowt;
    Item sec;
    long sec1;
    public intervals()
        rundy = new Form("Interwa&#322;y sportowe");
        exitCommand = new Command("Wyj&#347;cie", Command.EXIT, 2);
        addRound = new Command("Dodaj","Dodaj rund&#281;", Command.ITEM,1);
        delRound = new Command("Usu&#324;","Usu&#324; ostatni&#261; rund&#281;", Command.ITEM,1);
        start = new Command("Start", Command.ITEM,1);
        odliczanie = new Form("Odliczanie");
        TextField dodaj(TextField kolej)
            kolej=new TextField("Podaj czas (s) rundy "+parz,null, 4, TextField.NUMERIC);//stworzenie nowej instancji do wybierania czasu trwania rundy
            if(rundy.size()==0)
                rundy.insert(rundy.size(),kolej);
                else
                    rundy.insert(rundy.size()-1, kolej);
            return kolej;
        void odliczanie(TextField round)
            monitor m=new monitor();
            k=Integer.parseInt(round.getString());
            ekran.setCurrent(odliczanie);
            thread=new Licznik(k,odliczanie);
            thread.start();
            ekran.setCurrent(rundy);
    public void startApp()// throws MIDletStateChangeException
        rundy.deleteAll();
        repeat = new TextField("Podaj ilo&#347;&#263; powtórze&#324;",null,1,TextField.NUMERIC);
        rundy.addCommand(addRound);
        rundy.addCommand(exitCommand);
        rundy.setCommandListener(this);
        Canvas obrazek = new MyCanvas();
        ekran = Display.getDisplay(this);
        ekran.setCurrent(obrazek);
        czas=System.currentTimeMillis();
        while (System.currentTimeMillis()<czas+1000)
            continue;
        ekran.setCurrent(rundy);
    public void pauseApp()
    public void destroyApp(boolean unconditional)
        notifyDestroyed();
    public void commandAction(Command c, Displayable s)
        if (c == exitCommand)
            destroyApp(false);
            notifyDestroyed();
        else if(c==addRound)
            if(rundy.size()==0)//Sprawdzenie ilo&#347;ci elementów w celu poprawnego wy&#347;wietlania liczby rund w formie
                parz=1;
                else
                parz=rundy.size();
            switch(parz)
                case 1:
                    round0=dodaj(round0);break;
                case 2:
                    round1=dodaj(round1);break;
                case 3:
                   round2= dodaj(round2);break;
                case 4:
                    round3=dodaj(round3);break;
                case 5:
                    round4=dodaj(round4);break;
                default:
                    ostrz=new Alert("Uwaga","Maksymalna liczba rund wynosi 9", null, AlertType.INFO);
                    ostrz.setTimeout(3000);
                    ekran.setCurrent(ostrz);
            if(rundy.size()==1)
                rundy.append(repeat);
                rundy.addCommand(start);
            rundy.addCommand(delRound);
        else if(c==delRound)
            if(rundy.size()!=0)
                rundy.delete(rundy.size()-2);
                if (rundy.size()==1)
                    rundy.deleteAll();
                if(rundy.size()==0)
                    rundy.removeCommand(delRound);
                    rundy.removeCommand(start);
        else if(c==start)
            ilrund=rundy.size()-1;
            if(this.repeat.size()>0)
                ilpowt=Integer.parseInt(this.repeat.getString());
            ekran = Display.getDisplay(this);
            for (i=1; i<=ilpowt;i++)
                odliczanie= new Form("Odliczanie");
                 for (j=0;j<ilrund;j++)
                    switch(j)
                         case 0:
                             odliczanie(round0);
                             break;
                         case 1:
                             odliczanie(round1);
                             break;
                         case 2:
                             odliczanie(round2);
                             break;
                         case 3:
                             odliczanie(round3);
                             break;
                         case 4:
                             odliczanie(round4);
                             break;
                         case 5:
                             odliczanie(round5);
                             break;
                         case 6:
                             odliczanie(round6);
                             break;
                         case 7:
                             odliczanie(round7);
                             break;
                         case 8:
                             odliczanie(round8);
                             break;
    class Licznik extends Thread
        int czas1,k;
        Form forma;
        monitor m;
        public Licznik(int k,Form formap)
            czas1=k;
            forma=formap;
        public synchronized void run()
            while(czas1>0)
                forma.deleteAll();
                forma.append("Czas pozosta&#322;y (s): "+czas1);
                try{Thread.sleep(1000);} catch(InterruptedException e){e.printStackTrace();}
                czas1--;
            if(czas1<=0)
                m.put();
        }and monitor class
    public class monitor
    boolean busy=false;
    synchronized void get()
        if(!busy)
            try
                wait();
            }catch(InterruptedException e){e.printStackTrace();}
        notify();
    synchronized void put()
        if(busy)
            try
            wait();
            }catch(InterruptedException e){e.printStackTrace();}
        busy=true;
        notify();
    }Can anybody help me with this?

    Groovemaker,
    Your Licznik class has a member m of type monitor, which has not been instantiated (in other words is null) hence, when calling m.put() you get NullPointerException. Please also mind, that using Thread.sleep(1000) is not an accurate way of measuring time.
    If I may, please use recommended for Java class naming conventions - some of your names use lower case, while other don't which is confusing to the reader.
    Daniel

Maybe you are looking for

  • How to restore my iPhone , no internet , I cloud setting on and forgot passcode

    I Have an iPhone 4 I can't remember my passcode so My phones disabled i have my iCloud setting on but not internet so  I can't restore via find my laptop or find my iPhone Please can someone tell me how to restore my phone or atleast get into it MANY

  • FM to get the month name based on numeric value

    Hi , Is there any FM which returns the month name when we enter the corresponding numeric value . E.g. if the input is 3 the output must be March

  • House bank mass change

    Dear experts, Is it possiable to make mass changes for house bank? Please let me know transaction code? Regards babu

  • Scrolling thumbs gallery offset

    hi guys, i'm currently re-using a code snippet of xml gallery with scrolling thumbs, but i got a problem : my mask is stagewidth and my pictures holder depend of thumbs numbers, sometimes after resizing windows browser, while scrolling to the browser

  • Error 200220 with DAQmx

    I am trying to use a NI USB 6210 device with NI-DAQmx.  My application gets: Error -200220 occurred at DAQmx Create Channel (CO-Pulse Generation-Frequency).vi:1 Possible reason(s): Device identifier is invalid. Device Specified: Dev2 Task Name: _unna