Questions tagged [waitone]

29 questions
0
votes
2 answers

Event gets triggered after timeout is over

I have to wait for an event to be triggered. My initial solution was to use AutoResetEvent and WaitOne(), but the event was always triggered just after the waiting timeout was over. So I went back to the approach below, but I still have the same…
xsl
  • 17,116
  • 18
  • 71
  • 112
0
votes
0 answers

How to pause an AsyncWaitHandle.WaitOne(time) countdown

To describe briefly, the RunWithTimer runs a method, counts to 10, if the method took longer than 10 seconds to complete aborts it: void RunWithTimer() { Thread thread = null; Action action = () => { thread = Thread.CurrentThread; …
ParSa
  • 129
  • 2
  • 8
0
votes
1 answer

Wait Completed Due to abandoned mutex

While running the first instance of the below app it prints "Acquired". However if i start the second one it waits for 1 min. During that interval if press enter and leave the "first instance" it throws "Wait Completed Due to abandoned mutex"…
Kalyani Ramamurthy
  • 378
  • 2
  • 3
  • 13
0
votes
0 answers

Low level audio player with C# playback stutter - fix?

I am working on a small project (just for fun) that allows me to display the frequencies played back in my current audio buffer. The plan is: The thread that is executing the WaveOutPlayer.ThreadProc() method keeps playing and refilling two audio…
AudioGuy
  • 413
  • 5
  • 18
0
votes
1 answer

WaitHandle WaitOne Return

Exactly when does WaitHandle WaitOne(int timeout) return? Does it return when the timeout has elapsed? I see some code online which suggests polling WaitOne() when implementing logic which does some cleanup before exiting. This implies that…
TheWolf
  • 1,675
  • 4
  • 22
  • 34
0
votes
1 answer

C# form slowing down because of waitOne

I have a little problem, trying to code device to device porgram using JSON. My device to device is working well, I'm using it to send JSON to an other device throug a homemade D2D server. So one of my client is sending request to an other client…
0
votes
2 answers

Client Server file transfer

Starting with a small file transfer socket app in C# (mostly MS sample code for now). Having trouble with ManualResetEvent.WaitOne(). I'm calling it inside foreach loop so maybe that's the problem. In any case I'm trying to order/block the BeginSend…
steakoverflow
  • 1,206
  • 2
  • 15
  • 24
0
votes
1 answer

Unstable application uses SqlDependency. Several states and errors

I have a windows application using SqlDependency running at separated thread pool, this application represents a log monitor UI get the latest rows added in a specific table in the database and view it in a DataGridView. You can see the application…
Ahmed Negm
  • 865
  • 1
  • 11
  • 30
0
votes
1 answer

In Android OS what code do I use to set a ringback tone (waitone)?

I need my app to be able to change the ringback tone (The sound the other side hears when calling me, the funtone or waitone).
Rami
  • 39
  • 1
  • 6
0
votes
1 answer

Main thread not proceeding when child threads have finished

I am trying to use multithreading in my application. The method test5 tries to fetch some content from Internet, while the main thread waits for all threads to finish before continuing with other work. But my main thread doesn't come back after…
Hami
  • 335
  • 1
  • 7
  • 22
0
votes
2 answers

WP7 & Skydrive WaitOne blocking everything

I'm trying to download a file from SkyDrive and have wrapped the Asynchronous calls in a Synchronous class. However when I'm call WaitOne everything is blocked and the EventHandeler never gets called. _client = new…
user1122052
  • 341
  • 1
  • 3
  • 10
-1
votes
1 answer

Use two WaitOne() and Continue if one of them is Set()

I have a thread which is responsible for scheduled transferring of files. The files transferring schedule is mentioned in an XML file, which can be changed by the user at any time. I have created a FileSystemWatcher, which is responsible to keep…
skm
  • 5,015
  • 8
  • 43
  • 104
-1
votes
2 answers

C# AutoResetEvent WaitOne stopped by dispatcher

private void WaitForDriveToBecomeReady() { AutoResetEvent syncEvent = new AutoResetEvent(false); //set wait signal to use later //dispatcher to be able to change stuff in xaml from within thread Action action1 = new Action(delegate() {…
CodingYourLife
  • 7,172
  • 5
  • 55
  • 69
-2
votes
3 answers

C# Signaling two threads with AutoResetEvent

I need to create a program that counts to 10 using two threads. one threads should print even numbers and the other should print odd numbers. These threads should print the numbers in order (1, 2, 3, 4, 5...) I have done this code but it seems not…
Avi L
  • 1,558
  • 2
  • 15
  • 33
1
2