05-30-2012
Quote:
Originally Posted by
Brandon9000
Thanks, but what do you mean by "read cancellation point?"
As in reading, reading which you do, not the computer. Specifically, reading about cancellation points on the link he posted.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I have a written a script in korn shell for importing data into a oracle database. The shell invokes the import within the script. I want to kill this import (child process) . I tries using trap, but this does not kill the import even if i press cnt c. i have to login into other terminal... (2 Replies)
Discussion started by: yerics
2 Replies
2. Shell Programming and Scripting
I am calling another script from my main script and making it run in the background,based upon the value of the input provided by the user I want to kill the child process ,I have written this code
timer.ksh &
PID=$$
print "\n Do you wish to continue .. (Y/N) : \c "
read kill_proc
if ]... (4 Replies)
Discussion started by: mervin2006
4 Replies
3. Shell Programming and Scripting
I have a script that (ideally) starts tcpdump, sleeps a given number of seconds, then kills it.
When I do this for 10 seconds or and hour, it works fine. When I try it for 10 hours (the length I actually want) it just doesn't die, and will actually stick around for days.
Relevant part of my... (1 Reply)
Discussion started by: upnix
1 Replies
4. UNIX for Advanced & Expert Users
Hi,
Is there a way I can kill all the child processes of a process, given its process id.
Many thanks in advance.
J. (1 Reply)
Discussion started by: superuser84
1 Replies
5. UNIX for Advanced & Expert Users
Hi all,
I am writing a script which calls other third party scripts that perform numerous actions. I have no control over these scripts.
My problem is, one of these scripts seems to execute and do what it is meant to do, but my calling / parent script always exits at that point. I need to... (4 Replies)
Discussion started by: mark007
4 Replies
6. Solaris
Hi All
I have a separate thread ListenerThread having a socket listening to info broadcasted by some remote server. This is created in my main thread.
Because of requirements, once the separate thread is started I need to avoid any blocking function on the main thread. Once it comes to the... (2 Replies)
Discussion started by: manustone
2 Replies
7. Red Hat
Hi All,
Hope this is right area to ask this question.
I have a shell script (bash) "wrapper.sh", which contains few simple shell command
which executes a "server.sh" (conatins code to execute a java server) as a daemon.
Now what I want to kill this "server.sh" so that the server should... (2 Replies)
Discussion started by: jw_amp
2 Replies
8. Programming
Parent Thread Of Child Thread
Suppose a process creates some threads say threadC and threadD.
Later on each of these threads create new child threads say threadC1, threadC2, threadC3 etc. So a tree of threads will get created.
Is there any way to find out the parent thread of one such... (1 Reply)
Discussion started by: rupeshkp728
1 Replies
9. Shell Programming and Scripting
I'm likely going to explain this clumsily, so apologies in advance:
I have the following script:
#!/bin/bash
pidPrefix="logGen"
checkPrime ()
{
if /sbin/ifconfig eth0:0|/bin/grep -wq inet;then isPrime=1;else isPrime=0;fi
}
killScript ()
{
/usr/bin/find /var/run -name... (4 Replies)
Discussion started by: DeCoTwc
4 Replies
10. Solaris
Hello,
A little background on what we are doing first. We are running several applications from a CLI, and not all of them are fully functional. They do on occasion core dump, not a problem. We are running a service that takes a screen scrape of those apps and displays them in a more user... (5 Replies)
Discussion started by: Bryan.Eidson
5 Replies
LEARN ABOUT OPENSOLARIS
pthread_cancel
pthread_cancel(3C) Standard C Library Functions pthread_cancel(3C)
NAME
pthread_cancel - cancel execution of a thread
SYNOPSIS
cc -mt [ flag... ] file... -lpthread [ library... ]
#include <pthread.h>
int pthread_cancel(pthread_t target_thread);
DESCRIPTION
The pthread_cancel() function requests that target_thread be canceled.
By default, cancellation is deferred until target_thread reaches a cancellation point. See cancellation(5).
Cancellation cleanup handlers for target_thread are called when the cancellation is acted on. Upon return of the last cancellation cleanup
handler, the thread-specific data destructor functions are called for target_thread. target_thread is terminated when the last destructor
function returns.
A thread acting on a cancellation request runs with all signals blocked. All thread termination functions, including cancellation cleanup
handlers and thread-specific data destructor functions, are called with all signals blocked.
The cancellation processing in target_thread runs asynchronously with respect to the calling thread returning from pthread_cancel().
RETURN VALUES
If successful, the pthread_cancel() function returns 0. Otherwise, an error number is returned to indicate the error.
ERRORS
The pthread_cancel() function may fail if:
ESRCH No thread was found with an ID corresponding to that specified by the given thread ID, target_thread.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Committed |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
|Standard |See standards(5). |
+-----------------------------+-----------------------------+
SEE ALSO
pthread_cleanup_pop(3C), pthread_cleanup_push(3C), pthread_cond_wait(3C), pthread_cond_timedwait(3C), pthread_exit(3C), pthread_join(3C),
pthread_setcancelstate(3C), pthread_setcanceltype(3C), pthread_testcancel(3C), setjmp(3C), attributes(5), cancellation(5), condition(5),
standards(5)
NOTES
See cancellation(5) for a discussion of cancellation concepts.
SunOS 5.11 2 Nov 2007 pthread_cancel(3C)