Search Results

Search found 2053 results on 83 pages for 'signal'.

Page 55/83 | < Previous Page | 51 52 53 54 55 56 57 58 59 60 61 62  | Next Page >

  • Linux Kernel - Adding field to task_struct

    - by Drex
    I'm playing around with the linux kernel and added a struct field to the task_struct in sched.h. I know that can be costly but my struct is very small. I then initialize the new struct in INIT_TASK() and also re-initialize in fork.c copy_process() function so that when the INIT task or any other task creates a new process the process gets the init values. What then happens is when I try to run the kernel I get a SEGFAULT. The gdb error is: Locating the bottom of the address space ... Program received signal SIGSEGV, Segmentation fault. 0x08066ad7 in page_ok (page=) at arch/um/os-Linux/sys-i386/task_size.c:31 31 n = *address; It looks like it fails out in task_size. Is there anything else I need to do to add a field to task_struct?

    Read the article

  • How Two Programs Can Talk To Each Other In Java?

    - by Arnon
    My first time here... I want to ?reduce? the CPU usage/ROM usage/RAM usage - in general ?speaking?, all system resources that my App use - how doesn't? :) For this reason i want to split the preferences window from the rest of the application, and let the preferences window to run as ?independent? program. The preferences program ?should? write to a Property file(not a problem at all) and to send a "update signal" to the main program - which mean, to call the update method(that i wrote) that found in the Main class. How can i call the update method in the Main program from the preferences program? Or in the other hand... There is a way to build preferences window that take system resources just when it's appear? Is this approach - of separating programs and let them talk to each other(somehow) - is a right approach for speeding up my programs? tnx

    Read the article

  • Stopping looping thread in Java

    - by halfwarp
    I'm using a thread that is continuously reading from a queue. Something like: public void run() { Object obj; while(true) { synchronized(objectsQueue) { if(objectesQueue.isEmpty()) { try { objectesQueue.wait(); } catch (InterruptedException e) { e.printStackTrace(); } obj = objectesQueue.poll(); } } // Do something with the Object obj } } What is the best way to stop this thread? I see two options: 1 - Since Thread.stop() is deprecated, I can implement a stopThisThread() method that uses a n atomic check-condition variable. 2 - Send a Death Event object or something like that to the queue. When the thread fetches a death event it exists. I prefer the 1st way, however, I don't know when to call the stopThisThread() method, as something might be on it's way to the queue and the stop signal can arrive first (not desirable). Any suggestions?

    Read the article

  • Hiredis waiting for message

    - by Vivek Goel
    I am using hiredis C library to connect to redis server. I am not able to figure out how to wait for new messages after subscribing to new message. My code look like: signal(SIGPIPE, SIG_IGN ); struct event_base *base = event_base_new(); redisAsyncContext *c = redisAsyncConnect("127.0.0.1", 6379); if (c->err) { /* Let *c leak for now... */ printf("Error: %s\n", c->errstr); return 1; } redisLibeventAttach(c, base); redisAsyncSetConnectCallback(c, connectCallback); redisAsyncSetDisconnectCallback(c, disconnectCallback); redisAsyncCommand(c, NULL, NULL, "SET key %b", argv[argc - 1], strlen(argv[argc - 1])); redisAsyncCommand(c, getCallback, (char*) "end-1", "GET key"); redisAsyncCommand(c, getCallback, (char*) "end-1", "SUBSCRIBE foo"); Now how to tell hiredis to wait for message on channel ?

    Read the article

  • Using enums or a set of classes when I know I have a finite set of different options?

    - by devoured elysium
    Let's say I have defined the following class: public abstract class Event { public DateTime Time { get; protected set; } protected Event(DateTime time) { Time = time; } } What would you prefer between this: public class AsleepEvent : Event { public AsleepEvent(DateTime time) : base(time) { } } public class AwakeEvent : Event { public AwakeEvent(DateTime time) : base(time) { } } and this: public enum StateEventType { NowAwake, NowAsleep } public class StateEvent : Event { protected StateEventType stateType; public MealEvent(DateTime time, StateEventType stateType) : base(time) { stateType = stateType; } } and why? I am generally more inclined to the first option, but I can't explain why. Is it totally the same or are any advantages in using one instead of the other? Maybe with the first method its easier to add more "states", altough in this case I am 100% sure I will only want two states: now awake, and now asleep (they signal the moments when one awakes and one falls asleep).

    Read the article

  • QWebPage. How to handle failed request.

    - by user453482
    I want to handle failed requests (for example, with http 404 error code in reply), display my own "notfound.html" page in QWebView. But there is no simple way to handle replies with QWebView/QWebPage classes. As I see in Arora browser, for such requests uses next mechanism: QWebPage::setForwardUnsupportedContent(true), QWebPage::unsupportedContent signal and appropriate slot where you can handle qnetworkreply manually. But I cannot understand how it works, because unsupportedContent throws only when QWebPage cannot handle request scheme (like abrakadra://, ftp://, etc) or if reply consists of special header Content-Disposition: attachment. May be anybody know something about this ?

    Read the article

  • How to repaint another Qt class

    - by RR
    Hi all, I'm a new bit in Qt... I have a Qt GUI application (written by me), let's call it QtAPP.exe When QtAPP.exe running, I will use a QThread and QProcess to execute some external file, such as player.exe (written in native C). Here's my question: In QtAPP.exe, there are 2 classes, 1. QMainWindow - Core of QtAPP.exe 2. QThread - A thread class to execute external things For now, if I got a finished() signal in that QThread, how do I to force the QMainWindow to repaint itself ? Hope somebody can show me some tips, maybe sample code :) Any suggestion are welcome~

    Read the article

  • My app crashes on Iphone SDK 3.2

    - by Mladen
    Hi Guys, My app worked ok on iPhone SDK 3.1. However, when I try to run it in 3.2 simulator, I get the following error and it crashes: bool _WebTryThreadLock(bool), 0x5148280: Tried to obtain the web lock from a thread other than the main thread or the web thread. This may be a result of calling to UIKit from a secondary thread. Crashing now... Program received signal: “EXC_BAD_ACCESS”. When I debug it, it leads me to this peace of code: - (void)LoginViewToCheckView:(id)sender { CheckViewController *tempTestController = [[CheckViewController alloc] initWithStyle:UITableViewStyleGrouped]; [tempTestController setDelegate:self]; [self setCheckViewController: tempTestController]; [tempTestController release]; [navigationController pushViewController:checkViewController animated:YES];} Other thing worth mentioning is maybe that I am calling this function from a separate thread. Any ideas what could be wrong?

    Read the article

  • Terminating app due to uncaught exception / / SIGABRT // C++ please help!

    - by user282076
    I have just finished one of my apps when I got this message. I cannot for the life of me work out what is wrong. (gdb) continue 2010-02-26 14:05:51.443 BrainTester[2638:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] was unable to load a nib named "SplitSecondViewController"' 2010-02-26 14:05:51.452 BrainTester[2638:207] Stack: ( 861696817, 860329709, 861252493, 861252395, 835170725, 835170141, 835074651, 13515, 834774231, 834773467, 835014237, 835012689, 835011495, 861063661, 861449261, 861447005, 834770767, 834765939, 11025, 10920 ) terminate called after throwing an instance of 'NSException' Program r eceived signal: “SIGABRT”. (gdb) If someone can help, any help is appreciated.

    Read the article

  • ipod touch crashing after uploading app to device

    - by MaKo
    hi, I installed a new device (the second out of the 100), on xcode, an iPod touch but when I upload the app, the iPod crashes, apple logo shows, and gets frozen for a while, and then resusitates, in the xcode, I get the message on console: The Debugger has exited due to signal 15 (SIGTERM). I tried a simple app I made, and it loaded it, (some bouncing ball) after starting again, but tried the same with another app that plays some sounds and it shows normally, but doesnt play the sounds, questions: how to fix this issue? (in MyApp-info.plist, in bundle identifier, I have: com.yourcompany.${PRODUCT_NAME:rfc1034identifier} havent changed this, is this a problem?? 1.b. I used that conf to upload to an iPad with no problem?? Do the apps play normally sounds *.m4a, in the simulator it works!, not in the iPod, is this due to the crash or not? Thank you,, edit Im using AudioToolbox framework, the question after 1.b is 2 in my editor, but appears as 1 in the post??

    Read the article

  • vector segmentation fault

    - by user1849298
    I have a problem with the segmentation fault. Look: #include<fstream> using namespace std; int main(){ int n,i,vector[10001],vectorcopy[10001]; ifstream in("program.in"); ofstream out("program.out"); in>>n; for(i=1;i<=n;i++){ in>>vector[i]; vectorcopy[i]=vector[i]; } return 0;} And the debugger says: Program recived signal SIGSEGV, Segmentation fault Please, tell me what to do!

    Read the article

  • APP CAN'T LAUNCH IN XCODE

    - by user2977180
    I'm beginning to code in xCode 5 and I'm doing a really simple app. I just began and, when I try to test my game with iOS Simulator, the main page opens, but when I click on the button to launch the game, I'm redirected to xCode and this appears: #import "AppDelegate.h" #import "AppDelegate.h" int main(int argc, char * argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); } } and just next to it, this is written: Thread 1 : Signal SIGABRT I searched on internet and I just can't seem to find an answer. Could someone help me please???

    Read the article

  • [Android] GPS can't run inside TimerTask

    - by user568553
    Hi, I am trying to write an android app that acquires a GPS signal at a fix time interval, for example every 1 minute. Since the requestLocationUpdate function does not exactly implement that, I tried to use task to accomplished it. public class getGPS extends TimerTask{ public void run(){ System.out.println("Running a GPS task"); locHandler = new locationUpdateHandler(); myManager.requestLocationUpdates(provider, 60000, 0, locHandler); } } public void LoadCoords(){ Timer timer = new Timer(); timer.scheduleAtFixedRate(new getGPS(), 0, 60000); } However, from what I've seen, requestLocationUpdates would run fine if I put it inside LoadCoords(), but would not run if I put it inside the TimerTask (ie no green icon on the task bar to show that GPS is looking for a fix). Can anyone please suggest an alternative approach or pseudo-code, or correct my mistake if there is one ? Thank you in advance.

    Read the article

  • Is there an easy way in Python to wait until certain condition is true?

    - by Checkers
    I need to wait in a script until a certain number of conditions become true? I know I can roll my own eventing using condition variables and friends, but I don't want to go through all the trouble of implementing it, since some object property changes come from external thread in a wrapped C++ library (Boost.Python), so I can't just hijack __setattr__ in a class and put a condition variable there, which leaves me with either trying to create and signal a Python condition variable from C++, or wrap a native one and wait on it in Python, both of which sound fiddly, needlessly complicated and boring. Is there an easier way to do it, barring continuous polling of the condition? Ideally it would be along the lines of res = wait_until(lambda: some_predicate, timeout) if (not res): print 'timed out'

    Read the article

  • sigprocmask not working

    - by EpsilonVector
    I'm using sigprocmask as follows: void mask(){ sigset_t new_set,old_set; sigemptyset(&new_set); sigaddset(&new_set,SIGALRM); sigprocmask(SIG_BLOCK, &new_set, &old_set); } and to my surprise a function which prints a big list somehow gets interrupted by the signal, even though I invoke mask() at its beginning. It looks as if mask fails, since my function doesn't invoke any other functions and therefore nowhere in its run should an unmask() happen. What can cause sigprocmask to fail?

    Read the article

  • allow editing of config files by WIndows Server 2008 admins running non-elevated?

    - by Justin Grant
    My company produces a cross-platform server application which loads its configuration from user-editable configuration files. On Windows, config files are locked down at Setup time to allow reading by all users but restrict editing to Administrators only. Unfortunately, on Windows Server 2008, even local administrators no longer have admin privileges (because of UAC) unless they're running an elevated app. My question is: if a Windows Server 2008 admin wants to edit an admins-only config file, how does he normally do it? Is he forced to use a text editor which is smart enough to auto-elevate when elevation is needed, like Windows Explorer does in response to access denied errors? Or is there something that we can do in our app (e.g. in ACLs we lay down at setup time) which signal apps (or explorer) that elevation is needed before editing the file or which otherwise make our app friendlier to admins running on modern Windows OS's?

    Read the article

  • Django + dbxml + Apache = problems. Any solutions?

    - by Jason
    I'm trying to set up a Django application using WSGI. That works fine. However, I am having some issues with part of my Django app that uses BDB XML. My Apache config is as follows: Listen 8000 WSGISocketPrefix /tmp/wsgi <VirtualHost *:8000> ServerName <server name> DocumentRoot <path to doc root> LogLevel info WSGIScriptAlias / <path to wsgi> WSGIApplicationGroup %{GLOBAL} WSGIDaemonProcess debug threads=1 WSGIProcessGroup debug </VirtualHost> However, I'm still getting the following error: DB_ENV->repmgr_stat interface requires an environment configured for the replication subsystem [error] child died with signal 11 My environment is opened as: environment = DBEnv() environment.open( <absolute db env path>, DB_CREATE|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL, 0 ) I am using: python 2.6.2 apache 2.2 ubuntu 9.04 dbxml 2.5.13 compiled from source (so libdb-4.8, bsddb3, all that jazz) I see Apache seems to link to libdb-4.6. Is this a problem? ldd /usr/sbin/apache2 | grep libdb libdb-4.6.so => /usr/lib/libdb-4.6.so (0xb7c01000) Updated Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0xb5a48b90 (LWP 12700)] 0x00000000 in ?? () (gdb) thread apply all bt Thread 4 (Thread 0xb6a67b90 (LWP 12698)): #0 0xb7f11422 in __kernel_vsyscall () #1 0xb7de07b1 in select () from /lib/tls/i686/cmov/libc.so.6 #2 0xb7ea5bcf in apr_sleep () from /usr/lib/libapr-1.so.0 #3 0xb6d7afee in ?? () from /usr/lib/apache2/modules/mod_wsgi.so #4 0xb7ea38ec in ?? () from /usr/lib/libapr-1.so.0 #5 0xb7e6d4ff in start_thread () from /lib/tls/i686/cmov/libpthread.so.0 #6 0xb7de849e in clone () from /lib/tls/i686/cmov/libc.so.6 Thread 3 (Thread 0xb6249b90 (LWP 12699)): #0 0xb7f11422 in __kernel_vsyscall () #1 0xb7de07b1 in select () from /lib/tls/i686/cmov/libc.so.6 #2 0xb7ea5bcf in apr_sleep () from /usr/lib/libapr-1.so.0 #3 0xb6d7ab39 in ?? () from /usr/lib/apache2/modules/mod_wsgi.so #4 0xb7ea38ec in ?? () from /usr/lib/libapr-1.so.0 #5 0xb7e6d4ff in start_thread () from /lib/tls/i686/cmov/libpthread.so.0 #6 0xb7de849e in clone () from /lib/tls/i686/cmov/libc.so.6 Thread 2 (Thread 0xb5a48b90 (LWP 12700)): #0 0x00000000 in ?? () #1 0xb4f03b5e in DbXml::XmlManager::XmlManager () from /home/jason/dbxml-2.5.13/install/lib/libdbxml-2.5.so #2 0xb501b29b in _wrap_new_XmlManager (self=0x0, args=0xac66fcc) at dbxml_python_wrap.cpp:5183 #3 0xb6b77aed in PyCFunction_Call () from /usr/lib/libpython2.6.so.1.0 #4 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0 #5 0xb6bd70b5 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0 #6 0xb6bdb910 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0 #7 0xb6b6187a in ?? () from /usr/lib/libpython2.6.so.1.0 #8 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0 #9 0xb6b427a8 in ?? () from /usr/lib/libpython2.6.so.1.0 #10 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0 #11 0xb6b9ae03 in ?? () from /usr/lib/libpython2.6.so.1.0 #12 0xb6b90f55 in ?? () from /usr/lib/libpython2.6.so.1.0 #13 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0 #14 0xb6bd7618 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0 #15 0xb6bdb910 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0 #16 0xb6b6187a in ?? () from /usr/lib/libpython2.6.so.1.0 #17 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0 #18 0xb6b427a8 in ?? () from /usr/lib/libpython2.6.so.1.0 #19 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0 #20 0xb6bd3a34 in PyEval_CallObjectWithKeywords () from /usr/lib/libpython2.6.so.1.0 #21 0xb6b44a7d in PyInstance_New () from /usr/lib/libpython2.6.so.1.0 #22 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0 #23 0xb6bd7618 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0 #24 0xb6bdb910 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0 #25 0xb6b61969 in ?? () from /usr/lib/libpython2.6.so.1.0 #26 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0 #27 0xb6bd70b5 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0 #28 0xb6bdb910 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0 #29 0xb6b61969 in ?? () from /usr/lib/libpython2.6.so.1.0 #30 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0 #31 0xb6b427a8 in ?? () from /usr/lib/libpython2.6.so.1.0 #32 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0 #33 0xb6b9b483 in ?? () from /usr/lib/libpython2.6.so.1.0 #34 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0 #35 0xb6bd70b5 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0 #36 0xb6bdab4f in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0 #37 0xb6bdb910 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0 #38 0xb6b6187a in ?? () from /usr/lib/libpython2.6.so.1.0 #39 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0 #40 0xb6b427a8 in ?? () from /usr/lib/libpython2.6.so.1.0 #41 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0 #42 0xb6b9b483 in ?? () from /usr/lib/libpython2.6.so.1.0 #43 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0 #44 0xb6bd3a34 in PyEval_CallObjectWithKeywords () from /usr/lib/libpython2.6.so.1.0 #45 0xb6d7172d in ?? () from /usr/lib/apache2/modules/mod_wsgi.so #46 0xb6d7539f in ?? () from /usr/lib/apache2/modules/mod_wsgi.so #47 0xb6d7e1d8 in ?? () from /usr/lib/apache2/modules/mod_wsgi.so #48 0xb6d7a42c in ?? () from /usr/lib/apache2/modules/mod_wsgi.so #49 0xb6d7a8bd in ?? () from /usr/lib/apache2/modules/mod_wsgi.so #50 0xb6d7a9c5 in ?? () from /usr/lib/apache2/modules/mod_wsgi.so #51 0xb7ea38ec in ?? () from /usr/lib/libapr-1.so.0 #52 0xb7e6d4ff in start_thread () from /lib/tls/i686/cmov/libpthread.so.0 #53 0xb7de849e in clone () from /lib/tls/i686/cmov/libc.so.6 Thread 1 (Thread 0xb7460b00 (LWP 12697)): #0 0xb7f11422 in __kernel_vsyscall () #1 0xb7e75300 in sigwait () from /lib/tls/i686/cmov/libpthread.so.0 #2 0xb7ea3f3b in apr_signal_thread () from /usr/lib/libapr-1.so.0 #3 0xb6d7b48d in ?? () from /usr/lib/apache2/modules/mod_wsgi.so #4 0xb6d7bc98 in ?? () from /usr/lib/apache2/modules/mod_wsgi.so #5 0xb6d79632 in ?? () from /usr/lib/apache2/modules/mod_wsgi.so #6 0xb7e9a2c9 in apr_proc_other_child_alert () from /usr/lib/libapr-1.so.0 #7 0x08092202 in ap_mpm_run () #8 0x080673c8 in main () #0 0x00000000 in ?? ()

    Read the article

  • In a process using lots of memory, how can I spawn a shell without a memory-hungry fork()?

    - by kdt
    On an embedded platform (with no swap partition), I have an application whose main process occupies most of the available physical memory. The problem is that I want to launch an external shell script from my application, but using fork() requires that there be enough memory for 2x my original process before the child process (which will ultimately execl itself to something much smaller) can be created. So is there any way to invoke a shell script from a C program without incurring the memory overhead of a fork()? I've considered workarounds such as having a secondary smaller process which is responsible for creating shells, or having a "watcher" script which I signal by touching a file or somesuch, but I'd much rather have something simpler.

    Read the article

  • Global list in C/gtk+

    - by sterh
    Hello, I need in global list in my gtk+ application, i use for it GList: For example: I have structure: typedef struct _data { Glist list; }Data; I want to use one copy of the list in the whole program: I have a function bulid my list: gboolean build_list() { Data->list = g_list_append(mw->a, "First "); Data->list = g_list_append(mw->a, "Second "); Data->list = g_list_append(mw->a, "Third "); g_list_foreach(Data->list, (GFunc)printf, NULL); } After calling this function to display all items in the list. zbut when i try to make it in another function - for example: void foreach() { g_list_foreach(Data->list, (GFunc)printf, NULL); } I see error in gdb: *Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0xb7335700 (LWP 5364)] 0xb765a7d7 in strchrnul () from /lib/i686/cmov/libc.so.6 * How can i create global list in my application? Thank you.

    Read the article

  • Address of instruction causing SIGSEGV in external program

    - by karramba
    I want to get address of instruction that causes external program to SIGSEGV. I tried using ptrace for this, but I'm getting EIP from kernel space (probably default signal handler?). How GDB is able to get the correct EIP? Is there a way to make GDB provide this information using some API? edit: I don't have sources of the program, only binary executable. I need automation, so I can't simply use "run", "info registers" in GDB. I want to implement "info registers" in my own mini-debugger :)

    Read the article

  • How to know from a bash script if the user abruptly closes ssh session

    - by Figo
    I have a bash script that acts as the default shell for a user loging in trough ssh. It provides a menu with several options one of wich is sending a file using netcat. The netcat of the embedded linux I'm using lacks the -w option, so if the user closes the ssh connection without ever sending the file, the netcat command waits forever. I need to know if the user abruptly closes the connection so the script can kill the netcat command and exit gracefully. Things I've tried so far: Trapping the SIGHUP: it is not issued. The only signal issued i could find is SIGCONT, but I don't think it's reliable and portable. Playing with the -t option of the read command to detect a closed stdin: this would work if not for a silly bug in the embedded read command (only times out on the first invocation)

    Read the article

  • php cron jobs overlapping

    - by naveen gupta
    Hi I wrote few months back a script in perl for checking overlapping of jobs use Fcntl ':flock'; INIT { my $waitcount=12; # possible attemtps to run script my $waitseconds=300; # wait for $waitseconds each attempt my $lockstatus=0;#no lock was attained while ($waitcount > 0){ if (open LH, $0){ while ($waitcount > 0){ if (flock LH, LOCK_EX|LOCK_NB){ $waitcount=0;#signal end of waiting $lockstatus=1;#lock was attained } else{ --$waitcount;#decrement waitcount print "waiting to be able to lock $0\n"; sleep $waitseconds; }#end else }#end while }#end if else{ --$waitcount;#decrement waitcount print "waiting to be able to open $0\n"; sleep $waitseconds; }#end else }#end while if ($lockstatus == 0){ die "no lock was attained\n"; }#end if } I wanted to know if we can do similar thing in php .. How to integrate with your current php code which is running a part of php jobs?

    Read the article

  • Implementing traceback on i386

    - by markelliott2000
    Hi, I am currently porting our code from an alpha (Tru64) to an i386 processor (Linux) in C. Everything has gone pretty smoothly up until I looked into porting our exception handling routine. Currently we have a parent process which spawns lots of sub processes, and when one of these sub-processes fatal's (unfielded) I have routines to catch the process. I am currently struggling to find the best method of implementing a traceback routine which can list the function addresses in the error log, currently my routine just prints the the signal which caused the exception and the exception qualifier code. Any help would be greatly received, ideally I would write error handling for all processors, however at this stage I only really care about i386, and x86_64. Thanks Mark

    Read the article

  • cannot convert ‘mcontext_t*’ to ‘sigcontext*’ in assignment

    - by user353573
    i have checked asm/ucontext.h it should be sigcontext, but why pop up the error message cannot convert ‘mcontext_t*’ to ‘sigcontext*’ in assignment #include <stdio.h> #include <signal.h> #include <asm/ucontext.h> static unsigned long target; void handler(int signum, siginfo_t *siginfo, void *uc0){ struct ucontext *uc; struct sigcontext *sc; uc = (struct ucontext *)uc0; sc = &uc->uc_mcontext; sc->eip = target; } struct ucontext { unsigned long uc_flags; struct ucontext *uc_link; stack_t uc_stack; struct sigcontext uc_mcontext; sigset_t uc_sigmask; /* mask last for extensibility */ };

    Read the article

  • MiniDumpWriteDump segfault?

    - by Steven Penny
    I am trying to dump a process, say calc.exe When I run my program I get Program received signal SIGSEGV, Segmentation fault. 0x0000000000401640 in MiniDumpWriteDump () Here is the code #include <windows.h> #include <dbghelp.h> int main(){ HANDLE hFile = CreateFileA( "calc.dmp", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL ); DWORD procID = 196; HANDLE hProc = OpenProcess( PROCESS_ALL_ACCESS, FALSE, procID ); MiniDumpWriteDump( hProc, procID, hFile, MiniDumpNormal, NULL, NULL, NULL ); CloseHandle(hFile); }

    Read the article

< Previous Page | 51 52 53 54 55 56 57 58 59 60 61 62  | Next Page >