Thread.Join () does not work

I did a media player, and I use a database to store data, after playing a song for a while, I store the current position in the Pb, so I can continue to play the next time. I use a thread to update the db, so that he can play the next song at the same time what the db update.

The problem is when I close the application, I want the event dispatch thread to wait until the thread of db update is finished, the code is:

If (needWait == true) {}
logThread.join ();
}

but it seems don't work and make the application non-response, where will not?

A big loop on the thread of events blocks before the end of the loop.  But the OS won't know that the UI Thread is really busy.

However, thread. Join blocks just the thread of events...

So why don't; t it becomes sensitive?  There are all sorts of reasons.  Maybe the other Thread is not complete.  There may be something in this Thread that requires access to the event Thread, as synchronize the lock of the event or of nullity.  There may be something in this Thread that locks.  Or maybe the BlackBerry OS throws your Thread.join because it blocks the event Thread?

I do not know, and to be honest, I'm not sure that this is not important.  The important think is here to get your code to work and to do so, in my opinion, you need to move your join off the thread of events.

If you ignore this advice, it's good, I don't mind.  Your call - this is your code.  I've been wrong before, and I'll be wrong again.  But you have the best advice that I can give you.

And I must admit that I never use thread.join, even in Background Threads.  I always use wait/notify.  But that's just me.

Tags: BlackBerry Developers

Similar Questions

  • The background thread alert does not work

    Hello

    I have read the article http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800608/... and followed the instructions to display the background thread alert. However, the alert is not displayed and IU locks (freezes). Specifically, the event of click/touch does not work, but the background thread continues to run.

    Structure of my program. The main class (with the main function) extends UiApplication. I create in the function main instance of the class that extends the Application. This class starts backgorund wire. I am missing something or making the wrong way?

    Sorry I have expired, I was going to write a long response to this.

    But in short, remember that your automatic boot process and your user interface process, both through main with different parameters and are the BlackBerry is concerned, different applications.  So it may be an Application, the other can be a UiApplication, and both can enterTheDispatcher.

    No two instances of the same Application, they are two different Applications.  They can be of different instances of the same Application class, but it is a special case.  It depends on what you create in the main routine.

    You can play a merry dance with such things.  For example, having a UiApplication be started by the automatic boot process, and then the boot gui process can find it and just put in the foreground, rather than creating a new UiApplication.

    Generally however people create a request and a UiApplication.  The problem with the use of these different applications, is that things like static are not shared.  Therefore, use something like RuntimeStore to share data.  It is a pain and something that if I can avoid.

    It is perfectly possible to have a UiApplication, which starts when the device starts, runs Background Threads that are working in a network and is bought in the foreground by clicking on an icon.  Code is more complicated, but not much.  And you must have complicated the code when you run the network Threads background to deal with the unit off power and then power anyway.

    Hope that clarifies somethings.

  • Left Outer Join does not work why?

    Hello

    I have a question I want to return all the id group grp_id table and count and give me a count of all "active" members in the Member table. There are a few members who are not active in the table of members who belong to groups in the grp_id table. I still want a record returned for these grpid, but since there is no active members for these groups, I would like a zero as the mbr_count. An active mbr is the one whose eff_dt is less than the date of the day and whose exp_dt is greater than today's date.

    I have listed the query below, which returns active records mbr, but unfortunately does not return a grpid (as in my example of data) is not an active member (grpid: has ""). I have also provided the DDL for both tables as well as some examples of data that gives me the (Incorrect) results, that I posted. I have also posted what I need (the 'Correct' results).

    Thanks for any help... (I use PL/SQL)

    THE QUERY I USE:
    =============
    SELECT
    G00.grpid,
    Count (M00.grpid) mbr_count
    Of
    g00 grp_id
    LEFT OUTER JOIN
    m00 MBR on
    G00.grpid = m00.grpid
    WHERE
    M00.eff_dt < sysdate
    AND
    M00.exp_dt > sysdate
    GROUP BY
    G00.grpid

    It gives me results like:

    INCORRECT RESULTS:
    ===============
    GRPID MBR_COUNT
    A 2
    B 2
    C 1

    I want to see is:

    CORRECT RESULTS
    ===============
    GRPID MBR_COUNT
    A 2
    B 2
    C 1
    D 0


    Here's the DOF and the sample data:

    create table grp_id (grpid varchar (1))

    insert into grp_id values ('A')
    insert into grp_id values ('B')
    insert into grp_id values ('C')
    insert into grp_id values (')

    Commit

    create table mbr (mbr_name varchar (10), varchar (1) grpid, eff_dt date, exp_dt date)

    insert into values of mbr ('BRAND', 'A', to_date (January 1, 2011 ',' DD-MM-YYYY '), to_date (July 1, 2011 ',' DD-MM-YYYY '))
    insert into values of mbr ('BRAND', 'A', to_date (July 1, 2011 ',' DD-MM-YYYY '), to_date (1 January 2012 ',' DD-MM-YYYY '))

    insert into values of mbr ('MARTY', 'A', to_date (January 1, 2011 ',' DD-MM-YYYY '), to_date (July 1, 2011 ',' DD-MM-YYYY '))
    insert into values of mbr ('MARTY', 'A', to_date (July 1, 2011 ',' DD-MM-YYYY '), to_date (1 January 2012 ',' DD-MM-YYYY '))

    insert into values of mbr ('FRANK', 'B', to_date (January 1, 2011 ',' DD-MM-YYYY '), to_date (July 1, 2011 ',' DD-MM-YYYY '))
    insert into values of mbr ('FRANK', 'B', to_date (July 1, 2011 ',' DD-MM-YYYY '), to_date (1 January 2012 ',' DD-MM-YYYY '))

    insert into values of mbr ('MARY', 'B', to_date (January 1, 2011 ',' DD-MM-YYYY '), to_date (July 1, 2011 ',' DD-MM-YYYY '))
    insert into values of mbr ('MARY', 'B', to_date (July 1, 2011 ',' DD-MM-YYYY '), to_date (1 January 2012 ',' DD-MM-YYYY '))

    insert into values of mbr ('JOHN', 'C', to_date (January 1, 2011 ',' DD-MM-YYYY '), to_date (July 1, 2011 ',' DD-MM-YYYY '))
    insert into values of mbr ('JOHN', 'C', to_date (July 1, 2011 ',' DD-MM-YYYY '), to_date (1 January 2012 ',' DD-MM-YYYY '))

    insert into values of mbr ("NOAM" 'd', to_date (January 1, 2011 ',' DD-MM-YYYY '), to_date (July 1, 2011 ',' DD-MM-YYYY ') ")

    Thanks for the script, shame on the missing semicolon :)

    Your date restrictions are implemented as "filter predicates" rather than "join predicates.
    that is the difference between a place ANDS extra o in the JOIN clause.

    SQL> SELECT
      2  g00.grpid,
      3  count(m00.grpid) mbr_count
      4  FROM
      5  grp_id g00
      6  LEFT OUTER JOIN
      7  mbr m00 on
      8  g00.grpid = m00.grpid
      9  WHERE
     10  m00.eff_dt < sysdate
     11  AND
     12  m00.exp_dt > sysdate
     13  GROUP BY
     14  g00.grpid
     15  /
    
    G  MBR_COUNT
    - ----------
    A          4
    B          4
    C          2
    
    SQL> SELECT
      2  g00.grpid,
      3  count(m00.grpid) mbr_count
      4  FROM
      5  grp_id g00
      6  LEFT OUTER JOIN
      7  mbr m00 on
      8  g00.grpid = m00.grpid
      9  AND
     10  m00.eff_dt < sysdate
     11  AND
     12  m00.exp_dt > sysdate
     13  GROUP BY
     14  g00.grpid;
    
    G  MBR_COUNT
    - ----------
    D          0
    A          4
    B          4
    C          2
    
    SQL> 
    
  • Join does not work for NULL values on the join condition

    Hello

    I have the following problem.

    SQL > select * from a;

    X Y
    ---------- --------------------
    1
    2
    3
    4

    SQL > select * from b;

    A:
    ---------- --------------------
    1
    2



    SQL > select f.x, f.y, s.b in f, s b
    2 where f.x = s.b (+);
    X Y B
    ---------- -------------------- ----------
    1 1
    2 2
    4
    3




    SQL > select f.x, f.y, s.b in f, s b
    2 where f.x = s.b (+)
    3 and f.y = s.y;

    no selected line


    So now if I include a join condition more where null = null situation arises, it's working now.
    Just tell her not to treat (1 and null) (1 and null) are the same.
    What is the solution. This is an expected behavior.


    Thank you
    Pramod Garre

    Pramod salvation,

    Another way to use the outer join is,

    Select f.x, f.y, s.b
    of a, f, s b
    where f.x = s.b (+)
    and nvl(f.y,0) = nvl (s.y (+), 0);

    Hope this will help you.

    Thank you
    Amit

  • I just spent an hour to compose a response in a thread ("Firefox does not with paypal"), only to see "You do not have permission" to submit - total loss!

    I was connected to respond in the thread "Firefox does not work with paypal. I spent the best part of an hour carefully compose this response, case tests, links, etc... [Tip: Firefox, unlike other browsers, has a problem with the server paypalobjects.comscripts.] Because I had taken so long to write the answer, she seemed to be a good idea to check in via the Preview button, but I received a message that the service was not available. Of course, I decided to submit it anyway, but when I hit 'submit' I got a message "you don't have permission...". "- at which point I (stupidly) on another page with this message, and what I wrote was gone!

    Anyway, it is definitely not normal that the site log out after only an hour. Sorry to hear about this. Maybe there was a little problem on the server with your session. If it is reproducible, I wonder if you have any software that could be quietly elimination of cookies for the inactive sites?

  • How to join start in safe mode when the mouse does not work?

    (I'm on another computer to ask this question). I'm in safe mode; mouse does not work; arrow keys work but don't go to 'start '. How to get started?

    Assuming you have the office showing with all applications minimized or closed, Tab or F6 should pass the Start button and a few other "elements" on the taskbar.  Look closely and you will see a light preview highlighting of the selected item.  Press the Enter key to activate it.

    In XP Safe Mode, the cycle is start button > Quick Launch toolbar > [of any application taskbar icon] > clock > desktop icons.  While the Quick Launch toolbar is highlighted, the arrows move among the icons in the QL toolbar.  While the desktop icon is highlighted, the arrow keys will be touring all the desktop icons.

    Have a look here--> http://support.microsoft.com/kb/301583

  • Error updating Windows 10: does not work if the PC is joined to the domain

    My company requires that employees upgrade to Windows 10 before the deadline. When I went to install Windows 10 came an error message that says "Windows 10 does not work on this PC" and then told the user account: this PC is connected to a domain. Contact your system administrator

    Does anyone have an idea how to get around this problem? At least 2 other people in our office have successfully upgraded to Windows 10 without feeling it, and another co-worker gets the same error message.

    This is a screenshot of what happens:

    Your best option is to download the ISO and upgrade to a Local account.

    Step 1: How to download official Windows 10 ISO files

    Step 2: how: upgrade from previous versions of Windows using the file ISO for Windows 10

  • Scan with preview - several Pages of a PDF THAT does not work in Mac OS Sierra

    Hello everyone,

    I had upgraded my Macbook Pro (early 2011) to Mac OS Sierra. A famous feature of older versions of Mac OS is to use Preview to scan documents to PDF format, joined the pages scanned all of a single document.

    After upgrading to Sierra this feature does not work correctly. The pages are not more combined into a single PDF. Anyone who has observed the same problem?

    Best regards from the Germany

    Jörg

    Yes, it's been posted here several times.

  • the software sticky password does not work.

    the Sticky Password plugin does not work in Firefox 37.

    Changed the product forum this thread is in Thunderbird in Firefox so no need to create a duplicate thread.

    It is an Extension in Firefox and not a Plugin like Flash or Java.

    You're too test is based on the Beta channel (currently at 37.0b3), and the Extensions like these tends to do not support the current version at most which is Firefox 36. www.mozilla.org/Firefox/All/

    In the Sticky Password software you can go in "parameters - supported browsers and install the extension" because I think that may be the case there are updates? https://support.Mozilla.org/en-us/questions/948577

  • February 25, 2015, after agreeing the Firefox Hello does not work dwhelper. All proposed tests without success.

    I was download Firefox Hello a couple of days. dwhelper no longer works. I tested the extensions. As I only have two, dwhelper and add-on, it was easy to do.

    I use a lot dwhelper. I use online videos from many sources for my physics and astronomy, teaching needs.

    It is a problem with many video sites, not just YouTube.

    I deleted dwhelper and reinstalled. Firefox started and stopped. Rebooted my macbook pro as well.

    Program seems to be working and including window specifying the location to place the download file.

    Hello from Firefox is not a separate download - its share of Firefox itself. There is no direct interaction between your navigation and the morning of Firefox.

    It is more likely that Firefox updated to the latest version, and something in the change means that dwhelper does not work as well. I suggest you ask on the support site of the developer of the extension http://www.downloadhelper.net/documentation.php

    According to support threads this thread, there is also a beta version available that could solve your problem.

    Unfortunately its hard for us using extensions, they are developed by third parties.

  • Sound does not work for some Web sites

    Hello

    I can't listen to music on the following Web sites:

    http://www.cede.ch/en/music/?branch_sub=1 & View = detail & ID = 896510 & Branch = 1
    http://estastonne.bandcamp.com/album/live-in-Odeon-2011

    I use the first a lot, which is really annoying. I've already looked and I think that the problem has to do with firefox. I have a linux system. When I try to play music, I see the time meter that works perfectly, the only problem is: I have no sound. If I install firefox 25, I have no problem. With firefox 26 or 27 of firefox it does not work. With the same configuration (plugins for example) if I switch to firefox 25, all right. I tried clearing the cache, but it does not help. I have no idea more.

    If anyone has an idea that would be great!

    Thank you

    This looks like a problem with the player player of the second site.

    I don't know what flavor of Linux, this thread is running, but there is a problem with GSStreamer around the time 25-27 that has been activated.

    I'm looking into this site and see player video javascript. The GSStreamer is used only with html5 and h.264 and others have their own codec.

    After some research on this second site, its an mp3 file. It's called TralbumData which is a hack for streaming music bandcamp. They use the MP3 format to 128 for data flow. http://Bandcamp.com/help/audio_basics There is also no volume control.

    So to answer your question, it seems to have been something that has stopped working. Please make sure that your media player is updated if you update to version 27.

    The bug for this specific page is https://bugzilla.mozilla.org/show_bug.cgi?id=921714 which recommend to disable media.gstreamer.enabled, in the subject: config as well.

    That should solve the problem!

  • Firefox does not (Cup) of the lower edge and the right edge of the graph. IE10 does not work.

    Firefox does not (Cup) of the lower edge and the right edge of the graph. IE10 does not work.
    Office Windows 7 2009 service pack 1 Firefox 26 Internet Explorer 10
    Flash player version 11.9.900.170 plugin 11.9.900.170 activex version used by Firefox

    Problem began late November when Miniclip.com forced updated flash player to version above
    -C' was when they started to play a video advertising in the game box before you could start.

    Have screen shots of IE10 and Firefox26 side-by-side clearly showing the problem - how these can be downloaded for see you? E-mail? Web site? This place seems to be text only?

    In the meanwhile the grandchildren and self have learned to use IE10 instead of Firefox that we prefer.
    Their House of Windows XP has same Flash Player in Firefox and it works fine.

    Downloaded two screenshots on Media Gallery.

    You can not attach a screenshot in the first row who starts a thread, but you can do it in subsequent responses.

    Try disabling hardware acceleration in Firefox (you will need to close and restart Firefox).

    • Tools > Options > advanced > General > Browsing: "use hardware acceleration when available.

    See also:

    Reset the zoom of page on pages that are causing problems.

    • View > Zoom > reset (Ctrl + 0 (zero); 0 + Command on Mac)
  • I can't select or copy text on Firefox for Android 26.0.1 (device: Samsung Galaxy Note 2) OS: Android 4.3. Long press on the text does not work. )

    Can't select or copy text on Firefox for Android 26.0.1.
    Device: Samsung Galaxy 2 Note.
    OS: Android 4.3.
    Long press on the text does not work.

    I would ask someone to check that...

    I'm glad to hear that your problem has been resolved by using the beta version.

    If you have not already the case, please mark this thread as solved by the solution of marking.

    This will help other users experience similar problems helps to find faster and more efficiently.

    I hope that you will continue using our products and we thank you for contacting the Mozilla Support.

  • can't connect to my home internet income james ashley forgot it the link password does not work and the password I was given does not fit into the password box

    can't connect to my home internet income james ashley forgot it the link password does not work and the password I was given does not fit into the password box

    Are you sure that you do not have to register on this site through the usual way and what you should be used elsewhere on the site?

    Have you tried to contact them to help this topic or to check if they have a FAQ on this subject?

    I found this in another thread that you created [*]:

    I'm not sure do I bought a home income internet james ashley program and I copied the login info I was given and the password does not fit into the window of password and I forgot the link password does not work I sent emails, but do not receive an answer im don't know what to do is anyway you can help me to recover my info or help me change the password?

    I assume that you have downloaded and installed this program and need to use this password in this program or only you can use these data to download the program from the site james ashley?

  • keyconfig does not work with FF 24.0. Is there a way?

    I just finished rebuilding my PC from a hard drive format. In doing so, I loaded the last 24.0 FF.
    Part of my essential app is a script used keyconfig causes a single copy to send the source page to the Clipboard, where the script analysis. Unfortunately, keyconfig does not work with FF 24.0.

    Writing for easy copy begins to explain how acting on a combination of keys, rather than the action of the mouse, without the use of keycopy - but then told how he has no need, because it's too much effort, and besides - keyconfig exists and does the job - which, I agree, he used, very well - but it is no more.

    What should do? If there is no other way, can I get a downgrade of FF that works with keyconfig?

    There is a new add-on, key config (note the space), but it does not what keyconfig did.

    The end of the thread main support doesn't mention a major problem in Firefox 24: keyconfig 20110522 - mozillaZine Forums.

    Did you install from source: http://mozilla.dorando.at/keyconfig.xpi

    Is the problem that Firefox won't let you activate keyconfig, but the dialog box opens, or you can activate or extension allows you to create shortcuts but they do not work?

Maybe you are looking for