Skip to content

Commit

Permalink
c++:osh: Add a comment about the logger on Os_Funcs
Browse files Browse the repository at this point in the history
The logger must be dynamically allocated.

Signed-off-by: Corey Minyard <[email protected]>
  • Loading branch information
cminyard committed Sep 6, 2024
1 parent eae2c63 commit 5c5bd69
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions c++/include/gensio/gensioosh
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,17 @@ namespace gensios {
// This is a smart pointer like object.
class GENSIOOSHCPP_DLL_PUBLIC Os_Funcs {
public:
// Allocate an os function handlers for the platform.
// See gensio_alloc_os_funcs.3 for details. Note that if you
// pass in -1 for wait_sig, it will pick the default wait signal,
// Allocate an os function handlers for the platform. See
// gensio_alloc_os_funcs.3 for details. Note that if you pass
// in -1 for wait_sig, it will pick the default wait signal,
// SIGUSR1 on Unix type systems.
//
// The logger you pass in here *must* be dynamically
// allocated, the Os_Funcs takes over the task of freeing it
// when done. This is a little strange, but that way if the
// Os_Funcs here gets destroyed and another one outlives it, a
// locally allocated logger won't be deleted while still in
// use.
Os_Funcs(int wait_sig, Os_Funcs_Log_Handler *logger = NULL);

Os_Funcs(int wait_sig, Os_Funcs_Log_Handler *logger,
Expand Down

0 comments on commit 5c5bd69

Please sign in to comment.