Henrik Bach
2004-Sep-24 21:21 UTC
[LLVMdev] SlowOperationInformer.cpp:55: error:`SIGALRM' undeclared (first use this functi
>From: Reid Spencer <reid at x10sys.com> >Date: Fri, 24 Sep 2004 13:03:44 -0700 > >I just discovered that the *only* place this is used is in the debugger >when it is loading files, etc. There should be a way to do this without an >alarm. In fact, a thread could easily set the "ShouldShowStatus" every >second until the the thing is cancelled. Since the caller is required to >update the progress, this could also be done with time deltas without the >use of threads or signals. When I get the lib/System/TimeValue abstraction >implemented, I'll probably just update SlowOperationInformer to use >timestamp deltas rather than signals and avoid this whole problem >altogether.Okay, I'll comment the lines in question for now and see if other gotchas will show up.>Jeff Cohen wrote: > >>There's simply no equivalent to signals on Windows. There is no way to >>asynchronously interrupt a thread's processing to execute some handler. >>The only thing you can asynchronously do to a thread is kill it, and >>that's generally frowned upon (who knows what critical sections it might >>be holding, etc...). >> >>Stuff like alarms is supposed to be done using the "event-driven" style >>of programming, using the Windows message queue, APCs or I/O completion >>ports. You can do what Reid suggests below, but it begs the question of >>how one "rings the alarm" in the main thread. Set a flag that's >>periodically checked? Hmm... guess that's what this particular signal >>handler does anyway :) Actually, one can dispense with the extra thread >>by using waitable timers and periodically checking its state, so long as >>you don't plan on supporting Win95 or NT 3.1/3.5. >> >>It definitely belongs in lib/System. >> >>On Fri, 24 Sep 2004 12:00:10 -0700 >>Reid Spencer <reid at x10sys.com> wrote: >> >> >>>Ultimately, this is another function that needs to go into lib/System. An >>>alternate approach is to fork a thread, sleep, and when the thread wakes >>>up, "ring the alarm". >>> >>>Reid. >>> >>>John Criswell wrote: >>> >>>>Henrik Bach wrote: >>>> >>>> >>>>>Hi >>>>> >>>>>I'm compiling: >>>>>/usr/local/src/llvm/lib/Support/SlowOperationInformer.cpp on MinGW. >>>>>However, it stops complaining about that SIGALRM is undeclared: >>>> >>>> >>>>Is there an alarm() syscall on MinGW? And if so, what signal does it >>>>send (according to the MinGW docs)? >>>> >>>>-- John T. >>>> >>>> >>>>>-------------------------- >>>>>@ /usr/local/build/llvm/mklib --tag=disable-shared --silent --tag=CXX >>>>>--mode=compile g++ -c -I/usr/local/build/llvm/lib/Support >>>>>-I/usr/local/src/llvm/lib/Support -I/usr/local/build/llvm/include >>>>>-I/usr/local/src/llvm/include -I../../include >>>>>-I/usr/local/src/llvm/include -D__MINGW -D_GNU_SOURCE >>>>>-D__STDC_LIMIT_MACROS -Wall -W -Wwrite-strings -Wno-unused -g -D_DEBUG >>>>>/usr/local/src/llvm/lib/Support/SlowOperationInformer.cpp -o >>>>>/usr/local/build/llvm/lib/Support/Debug/SlowOperationInformer.lo >>>>>C:/MinGW/msys/local/src/llvm/lib/Support/SlowOperationInformer.cpp: In >>>>> constructor `llvm::SlowOperationInformer::SlowOperationInformer(const >>>>> std::string&)': >>>>>C:/MinGW/msys/local/src/llvm/lib/Support/SlowOperationInformer.cpp:55: >>>>>error: ` >>>>> SIGALRM' undeclared (first use this function) >>>>>-------------------------- >>>>> >>>>>On mingw the signal value SIGALRM isn't declared in <signal.h>. >>>>> >>>>>I can't figure out what to do next. Any suggestions? >>>>> >>>>>Henrik >>>>> >>>>>_________________________________________________________________ >>>>>Opret en gratis Hotmail-konto http://www.hotmail.com med udsigt til >>>>>250 MB lagerkapacitet >>>>> >>>>>_______________________________________________ >>>>>LLVM Developers mailing list >>>>>LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >>>>>http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev >>>> >>>> >>>> >>>_______________________________________________ >>>LLVM Developers mailing list >>>LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >>>http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev >> >> >>_______________________________________________ >>LLVM Developers mailing list >>LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >>http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev >> > >_______________________________________________ >LLVM Developers mailing list >LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev_________________________________________________________________ F� alle de nye og sjove ikoner med MSN Messenger http://messenger.msn.dk/
Reasonably Related Threads
- [LLVMdev] SlowOperationInformer.cpp:55: error: `SIGALRM' undeclared (first use this functi
- [LLVMdev] SlowOperationInformer.cpp:55: error:`SIGALRM'undeclared (first use this functi
- [LLVMdev] SlowOperationInformer.cpp:55: error: `SIGALRM' undeclared (first use this functi
- [LLVMdev] SlowOperationInformer.cpp:55: error: `SIGALRM' undeclared (first use this functi
- [LLVMdev] SlowOperationInformer.cpp:55: error: `SIGALRM' undeclared (first use this functi