From: pankaj bathwal <pbathwal@yahoo.com>
To: pthreads-win32@sources.redhat.com
Subject: cleaning of memory in pthread_create
Date: Tue, 10 Sep 2002 04:45:00 -0000 [thread overview]
Message-ID: <20020910114509.73572.qmail@web14508.mail.yahoo.com> (raw)
Hi,
This is regarding freeing of resource and cleaning of
memory allocated when "pthread_create" is called.
Most of my memory leaks tool says 'memory leak of 120
bytes allocated by calloc in "ptw32_new.c"'.
Is there any call that will free memory and resources?
Or there is some other way?
Regards
Pankaj
This is my sample code.
static int washere = 0;
void * func(void * arg)
{
washere = 1;
std::cout<<"Inside The THREAD "<<std::endl;
return 0;
}
int main()
{
pthread_t t;
assert(pthread_create(&t, NULL, func, NULL) == 0);
/* A dirty hack, but we cannot rely on pthread_join
in this
primitive test. */
Sleep(2000);
assert(washere == 1);
std::cout<<"Out side the THREAD "<<std::endl;
return 0;
}
__________________________________________________
Yahoo! - We Remember
9-11: A tribute to the more than 3,000 lives lost
http://dir.remember.yahoo.com/tribute
next reply other threads:[~2002-09-10 11:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-10 4:45 pankaj bathwal [this message]
2002-09-10 5:13 ` Ross Johnson
2002-09-10 5:28 Bossom, John
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020910114509.73572.qmail@web14508.mail.yahoo.com \
--to=pbathwal@yahoo.com \
--cc=pthreads-win32@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).