The GLib slice allocator has been obsoleted. Having a mixture of two
allocators can lead to hidden issues on systems that use different
implementations. Take the leap and replace everything with g_new/g_free.
Change-Id: I025c8383ef47b2c2472573360407fd6a6ca339b3
Solves a race condition when deleting a stream, as the fd might get
closed just as another thread tries to read from it, leading to EBADF
read error.
Change-Id: I8ea3ff72c2788ce3051a86a0bbd1650b03965376
Make the macro return the appropriate pointer type, and make sure the
free function takes an argument of the same type. This also eliminates
some boilerplate type-casting code.
Change-Id: I3094271fa2c53ec93b9ff9f837d461cf422e0f12
Convenience wrapper for &STR()
This is useful so that STR() and STR_DUP() can be extended to avoid
duplicate expansion of its macro arguments.
Change-Id: Ieae170807c11b0cdd8b52fac9bab98dccdc2b951
Obsolete str_init(), rename STR_INIT() to just STR(), and replace all
instances of str_init() with STR().
no-op
Change-Id: I981529063ad2ea26089add467f7a84b638dbf423
To support asynchronous pollers which may hold references on underlying
sockets, let the poller close the socket after it has released its
references. This prevents cases of file descriptor re-use while an
underlying socket is still open.
Add reset_socket() to be used in place of close_socket() which does the
same thing except the actual closing of the socket.
Add poller_del_item_callback() for cases where more action than just
closing the file descriptor is needed.
Change-Id: Iefda1487ecb89263729120ecb964436dd79b2a0e
The poller-per-thread feature was broken with a division by zero. Take
the opportunity to rework it and eliminate the poller_map object. Use a
simple array of pollers for media sockets, plus one global poller for
control sockets. In the regular case only one poller is created and
everything points to that poller. In the poller-per-thread case, one
poller per thread is created, plus one poller (also with its own single
thread) for control connections. All control sockets use the single
control poller, while all media sockets get assigned one poller from the
pool in a round-robin fashion.
closes#1801
Change-Id: Iae91a3e10b7206455c6df33b1a472254c700ce21