Hello,

if I look up a pointer to a socket with the function rt_socket_lookup(), an reference 
counter in the sockets structure is incremented. What do I have to do to get this 
counter decremented after I do not need the pointer to the socket any more?


http://www.rts.uni-hannover.de/rtnet/lxr/source/socket.c#L158

162 struct rtsocket *rt_socket_lookup(int fd)
163 {
[...]
169     if ((index = fd & 0xFF) < RT_SOCKETS) {
170         rtos_spin_lock_irqsave(&socket_base_lock, flags);
171 
172         if (rt_sockets[index].fd == fd) {
173             sock = &rt_sockets[index];
174             atomic_inc(&sock->refcount);
175         }


-- 
Hans-Peter Bock
Dipl.-Ing.

ISW - Universitaet Stuttgart
Rosenbergstr. 28
D-70174 Stuttgart

http://www.isw.uni-stuttgart.de/

Attachment: signature.asc
Description: Digital signature

Reply via email to