Differences From Artifact [44498ce7a3]:
- File
src/OFKernelEventObserver.h
— part of check-in
[ba62f00fac]
at
2015-11-29 14:20:53
on branch trunk
— Clean up optional protocols
Now that we can require GCC >= 4.6, we no longer need to have a category
on OFObject that adds the optional protocol to it. (user: js, size: 6542) [annotate] [blame] [check-ins using]
To Artifact [4fe6de3289]:
- File
src/OFKernelEventObserver.h
— part of check-in
[e9b4700cb6]
at
2015-12-29 21:33:07
on branch trunk
— Refactor OFKernelEventObserver
This moves the locked queue for actions to
OFKernelEventObserver_LockedQueue, which is now used for select and
poll, but skipped for kqueue and epoll, as they natively support changes
from another thread.This fixes the problem that removing an object is delayed until the next
observe call - at which point it might have already been closed, meaning
the fd is no longer available. This was mainly a problem with kqueue, as
closing the fd already removed it from the kqueue, which then resulted
in an error being returned when trying to manually remove the fd from
the kqueue. (user: js, size: 6314) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
17 18 19 20 21 22 23 | #import "OFObject.h" #import "socket.h" OF_ASSUME_NONNULL_BEGIN @class OFMutableArray OF_GENERIC(ObjectType); | < < < < < | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | #import "OFObject.h" #import "socket.h" OF_ASSUME_NONNULL_BEGIN @class OFMutableArray OF_GENERIC(ObjectType); @class OFDate; /*! * @protocol OFKernelEventObserverDelegate * OFKernelEventObserver.h ObjFW/OFKernelEventObserver.h * * @brief A protocol that needs to be implemented by delegates for |
︙ | ︙ | |||
108 109 110 111 112 113 114 | */ @interface OFKernelEventObserver: OFObject { OFMutableArray OF_GENERIC(id <OFReadyForReadingObserving>) *_readObjects; OFMutableArray OF_GENERIC(id <OFReadyForWritingObserving>) *_writeObjects; | < < < < < | 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | */ @interface OFKernelEventObserver: OFObject { OFMutableArray OF_GENERIC(id <OFReadyForReadingObserving>) *_readObjects; OFMutableArray OF_GENERIC(id <OFReadyForWritingObserving>) *_writeObjects; id <OFKernelEventObserverDelegate> _delegate; #ifdef OF_HAVE_PIPE int _cancelFD[2]; #else of_socket_t _cancelFD[2]; struct sockaddr_in _cancelAddr; #endif } /*! * The delegate for the OFKernelEventObserver. */ @property OF_NULLABLE_PROPERTY (assign) id <OFKernelEventObserverDelegate> delegate; |
︙ | ︙ |