For threads it's common to have to check if a mask contains more than
one bit set. Let's have this "atleast2()" function report this.
return cnt;
}
+/* returns non-zero if <a> has at least 2 bits set */
+static inline unsigned long atleast2(unsigned long a)
+{
+ return a & (a - 1);
+}
+
/* Simple ffs implementation. It returns the position of the lowest bit set to
* one. It is illegal to call it with a==0 (undefined result).
*/