CLEANUP: threads: use nbits to calculate the thread mask

It's pointless to do arithmetics by hand, we have a function for this.
1 file changed