Creates a mask for all priorities up to and including pri.
pri
int LOG_UPTO(int pri) => (1 << (pri + 1)) - 1;