diff options
Diffstat (limited to 'hurd/hurd/userlink.h')
-rw-r--r-- | hurd/hurd/userlink.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/hurd/hurd/userlink.h b/hurd/hurd/userlink.h index 6acfaa88af..66c04067a1 100644 --- a/hurd/hurd/userlink.h +++ b/hurd/hurd/userlink.h @@ -76,6 +76,12 @@ struct hurd_userlink /* Attach LINK to the chain of users at *CHAINP. */ +extern void +_hurd_userlink_link (struct hurd_userlink **chainp, + struct hurd_userlink *link); + +#if defined __USE_EXTERN_INLINES && defined _LIBC +# if IS_IN (libc) _HURD_USERLINK_H_EXTERN_INLINE void _hurd_userlink_link (struct hurd_userlink **chainp, struct hurd_userlink *link) @@ -96,11 +102,17 @@ _hurd_userlink_link (struct hurd_userlink **chainp, link->thread.prevp = thread_chainp; *thread_chainp = link; } +# endif +#endif /* Detach LINK from its chain. Returns nonzero iff this was the last user of the resource and it should be deallocated. */ +extern int _hurd_userlink_unlink (struct hurd_userlink *link); + +#if defined __USE_EXTERN_INLINES && defined _LIBC +# if IS_IN (libc) _HURD_USERLINK_H_EXTERN_INLINE int _hurd_userlink_unlink (struct hurd_userlink *link) { @@ -123,6 +135,8 @@ _hurd_userlink_unlink (struct hurd_userlink *link) return dealloc; } +# endif +#endif /* Clear all users from *CHAINP. Call this when the resource *CHAINP @@ -131,6 +145,10 @@ _hurd_userlink_unlink (struct hurd_userlink *link) value is zero, someone is still using the resource and they will deallocate it when they are finished. */ +extern int _hurd_userlink_clear (struct hurd_userlink **chainp); + +#if defined __USE_EXTERN_INLINES && defined _LIBC +# if IS_IN (libc) _HURD_USERLINK_H_EXTERN_INLINE int _hurd_userlink_clear (struct hurd_userlink **chainp) { @@ -143,5 +161,7 @@ _hurd_userlink_clear (struct hurd_userlink **chainp) *chainp = NULL; return 0; } +# endif +#endif #endif /* hurd/userlink.h */ |