wait

program stuck on wait()

梦想的初衷 提交于 2019-12-11 13:47:15
问题 I'm having an issue with a process being stuck on wait. I've been troubleshooting this issue and its the only bug i have currently for my shell program. The problem is the program should exit when the user enters "exit". However it seems if the user enters an invalid string the program gets stuck on wait(). this results in having to type exit twice to exit instead of once. How do I stop this from happening, how do i exit from the wait() call when a user enters a dumb string? Steps to

System hanged and CPU high under kernel code wait_event() and wake_up()

吃可爱长大的小学妹 提交于 2019-12-11 12:46:51
问题 I have two kernel threads which run a() and b() respectively. a() is trying to wake up b() as follows. a() { while(1) { while( atomic_read(status) != SET_SLEEP ) msleep(10); atomic_set(status, SET_RUN); printk( "..." ); wake_up( wq ); } b() { while(1) { atomic_set(status, SET_SLEEP); printk( "..." ); wait_event( wq, atomic_read(status) != SET_SLEEP ); printk( "..." ); } After running both for a long time, whole system will be hanged and CPU got high. No any panic message is printed. Is there

How to wait for a MouseListener mouse press?

回眸只為那壹抹淺笑 提交于 2019-12-11 11:52:51
问题 So, I know this question has been asked before, but thoes answers will not work for the current structure of my program. I have a game of tic-tac-toe. In the games algorithm, when its time for a users turn I have it call a method to get the X & Y coords of a Mouse Click. However, I would like this method to first prompt a user for a click, then wait for the user to click, THEN get the x & y of the click for the game algorithm to use. Currently, it is just pulling the x & y of the last click

How to get wait loader during AJAX call

空扰寡人 提交于 2019-12-11 10:46:48
问题 I do AJAX request through below code. it works fine. Problem is, it takes time to post the data to database but screen UI is enable and allow to do other action on UI. I want to intimate user for - Wait loader, prcessing, in progress or disable the UI kind of intimation that processing is still in progress. $.ajax({ contentType: 'application/json; charset=utf-8', dataType: 'json', type: 'POST', url: '/travel/Submittraveller', data: f, success: function (jsonresult) { console.log("success"); /

Thread.sleep works but implicit wait, webdriverwait and fluent wait does not?

蹲街弑〆低调 提交于 2019-12-11 10:19:27
问题 driver.findElement(By.xpath(sOptionPath)).click(); //this option button changes contents of page Thread.sleep(4000); WebElement combo=driver.findElement(By.xpath(sXpath)); Select dropdownvalue = new Select(combo); dropdownvalue.selectByVisibleText(sText); This above code works fine but if I use wait instead of thread.sleep I get StaleElementReferenceException exception. This is the Fluent wait I used : Wait<WebDriver> newwait=new FluentWait<WebDriver>(driver).withTimeout(10, TimeUnit.SECONDS)

Call JavaFX in Java program and wait for wait to exit before running more code

橙三吉。 提交于 2019-12-11 09:49:30
问题 In my java program i give some options to the user and one of thems calls a JavaFXProgram to display something. I only want to run more code in the Java program when this JavaFX that got called actually exits, it may take 5 seconds, it may take a minute. Ideally what i would like is something like we have in Android. We call startActivityForResult() and then wait for the call of onActivityResult() . How can i achieve similar behaviour in my situation? I have this code that i wrote to try to

Java Wait/Notify not working

↘锁芯ラ 提交于 2019-12-11 09:08:15
问题 So I have been working on a simple wait/notify example in Java and for some reason I have not been able to get it to run properly. If anyone is able to see what might be the issue It would be very appreciated! public class ThreadDemonstration { private String str = null; Thread stringCreator = new Thread(new Runnable() { public void run() { synchronized(this) { str = "I have text"; notify(); } } }); private Thread stringUser = new Thread(new Runnable() { public void run() { synchronized(this)

ExpectedCondition method attributeContains for C#

不羁岁月 提交于 2019-12-11 07:10:11
问题 I was trying to use "attributeContains" method but I don't have it avaible when using C#. https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/support/ui/ExpectedConditions.html#attributeContains-org.openqa.selenium.WebElement-java.lang.String-java.lang.String- Any workaround? 回答1: You can always create your custom Expected Condition : public void AttributeContains(By locator, String attribute, String value, int secondsToWait = 30) { new WebDriverWait(driver, new TimeSpan(0

How to wait for each process to terminate in the following example?

大兔子大兔子 提交于 2019-12-11 06:46:57
问题 The program terminates after taking 4 or 5 values from scanf . But I want it to accept 8 values (totaling 8 processes) and then terminate. void main() { fork(); fork(); fork(); scanf("%d",&j); printf("The values are %d\n",j); wait(0); } 回答1: Well, the first question you have to answer to yourself is how many processes you think you have there? As you don't use the returned value from the fork(2) system call, you don't know even if you are the parent or you are the child after execution of

Waiting .1 second until hiding an image

泪湿孤枕 提交于 2019-12-11 06:29:46
问题 I am making a small program in C# for Windows Phone. One thing that it should do is hide a toolbar of buttons whenever the user taps the "Hide" button. I've finished the code to hide the toolbar. It hides the buttons, like expected. But what happens now is that all the buttons disappear at once. In order to make a sort of "animation", I've decided to wait .1 second until hiding all the buttons. How would I wait .1 second? Here's my code right now. bool panelopened = false; private void image1