diff options
author | Christopher Faylor <me@cgf.cx> | 2012-06-03 22:02:45 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2012-06-03 22:02:45 +0400 |
commit | 3143cb7c00fc1b6f4d75a83ac28f3bfbc5d2e658 (patch) | |
tree | fb4a3fbfc0eea1168646125aca7fd53478418b00 /winsup/cygwin/cygheap.h | |
parent | ff80d22a7c3d0d330c2892686aa694a080b109cb (diff) |
* DevNotes: Add entry cgf-000011.
* fhandler.h (fhandler_base::refcnt): Delete.
(fhandler_base::inc_refcnt): New function.
(fhandler_base::dec_refcnt): New function.
* cygheap.h (cygheap_fdnew::~cygheap_fdnew): Accommodate split of refcnt to
inc_refcnt/dec_refcnt.
(cygheap_fdget::cygheap_fdget): Ditto.
(cygheap_fdget::~cygheap_fdget::cygheap_fdget): Ditto.
* dtable.cc (dtable::release): Ditto.
(cygwin_attach_handle_to_fd): Ditto.
(dtable::init_std_file_from_handle): Ditto.
(dtable::dup3): On success, return with fdtab locked.
* dtable.h (dtable): Add dup_finish as a friend.
* syscalls.cc (dup_finish): Define new function. Increment refcnt while fdtab
is locked.
(dup2): Use common dup_finish() to perform dup operation.
(dup3): Ditto.
Diffstat (limited to 'winsup/cygwin/cygheap.h')
-rw-r--r-- | winsup/cygwin/cygheap.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/winsup/cygwin/cygheap.h b/winsup/cygwin/cygheap.h index 4895019aa..f2b0cd9ec 100644 --- a/winsup/cygwin/cygheap.h +++ b/winsup/cygwin/cygheap.h @@ -458,7 +458,7 @@ class cygheap_fdnew : public cygheap_fdmanip ~cygheap_fdnew () { if (cygheap->fdtab[fd]) - cygheap->fdtab[fd]->refcnt (1); + cygheap->fdtab[fd]->inc_refcnt (); } void operator = (fhandler_base *fh) {cygheap->fdtab[fd] = fh;} }; @@ -476,7 +476,7 @@ public: this->fd = fd; locked = lockit; fh = cygheap->fdtab[fd]; - fh->refcnt (1); + fh->inc_refcnt (); } else { @@ -491,7 +491,7 @@ public: } ~cygheap_fdget () { - if (fh && fh->refcnt (-1) <= 0) + if (fh && fh->dec_refcnt () <= 0) { debug_only_printf ("deleting fh %p", fh); delete fh; |