cls -> sec fixed: mutex + cond. variable
cmdline-args: switch to long_opts