Various optimisations of bitmask processing. External change is that bitmask_clear() does not apply a spinlock, so must be called with exclusive access to the bitmask. This affects the call in shutdown processing in poll management. The call from DCB processing is safe because zombie processing has exclusive access to DCBs.
This commit is contained in:
@ -41,18 +41,21 @@
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
SPINLOCK lock; /**< Lock to protect the bitmask */
|
||||
unsigned char *bits; /**< Pointer to the bits themselves */
|
||||
unsigned int length; /**< The number of bits in the bitmask */
|
||||
SPINLOCK lock; /**< Lock to protect the bitmask */
|
||||
unsigned char *bits; /**< Pointer to the bits themselves */
|
||||
int length; /**< The number of bits in the bitmask */
|
||||
int size; /**< The number of bytes in the bitmask */
|
||||
|
||||
} GWBITMASK;
|
||||
|
||||
extern void bitmask_init(GWBITMASK *);
|
||||
extern void bitmask_free(GWBITMASK *);
|
||||
extern void bitmask_set(GWBITMASK *, int);
|
||||
extern void bitmask_clear(GWBITMASK *, int);
|
||||
extern int bitmask_clear(GWBITMASK *, int);
|
||||
extern int bitmask_clear_with_lock(GWBITMASK *, int);
|
||||
extern int bitmask_isset(GWBITMASK *, int);
|
||||
extern int bitmask_isallclear(GWBITMASK *);
|
||||
extern void bitmask_copy(GWBITMASK *, GWBITMASK *);
|
||||
extern char *bitmask_render_readable(GWBITMASK *bitmask);
|
||||
extern char *bitmask_render_readable(GWBITMASK *);
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user