Questions tagged [wait]

In programming, 'wait' refers to the act of pausing the execution of a program until a specific condition is met or a given amount of time has passed.

In programming, 'wait' refers to the act of pausing the execution of a programm until a specific condition is met or a given amount of time has passed.

3454 questions
1
vote
1 answer

How to echo the missing selector in a CasperJS onWaitTimeout event handler?

I have many casper.waitForSelector parts in my script. Anyway I would like to know whenever it times out. Therefore I added: casper.options.onWaitTimeout = function() { //how to echo Selector which timed out here }; Furthermore I would like to…
Senju
  • 435
  • 2
  • 5
  • 20
1
vote
0 answers

Waiting to take at least get 10 samples for PhoneStateListener [LISTEN_SIGNAL_STRENGTHS]

Currently I'm writing a Service which has to take the Signal Strength of user's mobile set. For this matter, I've implemented an inner class for the Service (lets say myPhoneStateListener) which extends the PhoneStateListener, and by overriding…
atari83
  • 489
  • 1
  • 5
  • 15
1
vote
2 answers

Wait and Notify in Java threads for a given interval

i am working on a usecase as below. I am new to multi threading and facing this issue with using it. I broadcast a event on network. Its received by all the listeners, and they unicast me with their information. This is received inside the call…
Punith Raj
  • 2,164
  • 3
  • 27
  • 45
1
vote
2 answers

PhantomJS javascript wait until function complete

I have a problem with a PhantomJS script. The script gets a JSON encoded string from a web page and does other things with it. The script: var address = address; var amount = 0; function changeAmount() { var page=require('webpage').create(); …
1
vote
0 answers

PHP script wait for previous one to finish

I have this example script: /tmp/test >/tmp/test &'); $time2 = time(); echo $time2 - $time; ?> when I run it for the first time it show immediately 0 , but when I run it for the…
elarichi.y
  • 57
  • 8
1
vote
0 answers

C Multithread: Wait Until (expression);

I'm building a multithread applications. My threads have to execute an instruction block only if a pointer becomes !=nil void *fun(struct coordinates *app){ struct coordinates coord; coord.x = app->x; coord.y = app->y; //printf("\n %p %d %d",…
osharko
  • 204
  • 3
  • 19
1
vote
1 answer

javascript setAttribute function

I have a problem with the setAttribute function. Here my code mind.SetRequest(rec_input.value); mind.Reply(); element.setAttribute('text', mind.GetReply()); element.speak(); element.speak() isn't waiting for setAttribute to be completed. Is there…
Gor
  • 2,808
  • 6
  • 25
  • 46
1
vote
1 answer

Can't wake up threads

I've got problems waking up Threads. In my program there must be a moving Thread called Bus and several climbers who tries to enter the Bus to go somewhere else. The Bus must be always in movement(except when is waiting for the climbers to get…
Anarion321
  • 25
  • 1
  • 4
1
vote
2 answers

wait for Future in for loop

I'm having a future which is a result of an sql query, in it I'm looping over each returned row to add it to a list with a map to encode it to a json format later. In this loop I'm executing another query depending on the result in each row of the…
fsulser
  • 853
  • 2
  • 10
  • 34
1
vote
3 answers

Object.wait(0) waits forever

I have below piece of code, where the wait time is calculated elsewhere. In some of the situations the wait time value is 0. What I notice is that when the wait time is zero the thread seem to wait forever. I could not find anything specific to this…
Ravisha
  • 3,261
  • 9
  • 39
  • 66
1
vote
1 answer

Wait inside loop bash

I have created a loop to read through a .txt and execute another shell using each line as input. PROBLEM: I need the loop to execute the first two lines from the txt in parallel, wait for them to finish, then execute the next two lines in parallel.…
1
vote
1 answer

qt wait for signal/event, GUI

I am working on an Qt application which has the possability to use a script to perform several actions. One command within the script requires an external event to happen until the next command in the list can be computed (which is not the case for…
user3482407
  • 319
  • 3
  • 18
1
vote
3 answers

Checking exit codes of two processes

I have this code: pid_t pid1 = fork(); if (pid1 == 0) { //do some stuff if (something) exit(0); else exit(1); } else if (pid1 == -1) printf("error\n"); pid_t pid2 = fork(); if (pid2 == 0) { //do…
sykatch
  • 301
  • 1
  • 2
  • 13
1
vote
1 answer

Java Wait/Notify Within Reentrant Synchronized Blocks

My understanding of Java synchronized() blocks is that, if a thread already owns a lock on an object, it can enter a different block synchronized on the same object (re-entrant synchronization). Underneath, I believe that the JVM uses a reference…
1
vote
2 answers

Java Object.wait(long, long) Implementation different from Documentation

The method Object#wait(long, long) in java.lang.Object states in it's documentation that This method is similar to the wait method of one argument, but it allows finer control over the amount of time to wait for a notification before giving up.…
Clashsoft
  • 11,553
  • 5
  • 40
  • 79