This is the mail archive of the cygwin-patches mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] cygwin_internal methods to get/set thread name


Hi Mark,

A lot to discuss here.

First of all, can you please describe the scenario in which you'd want
to give a cygthread another name?  Why is the one given at
cygthread::create time not sufficient?

Also, why should we need another, non-standard way to read/write a
pthread name, other than pthread_getname_np/pthread_setname_np?  What is
that supposed to accomplish?  Is there really any real-world scenario
which you can't handle with the official entry points?

We really don't want to add more non-standard entry points than
absolutely necessary.  There are too many already, partially for
historic reasons.

On Dec 20 00:08, Mark Geisert wrote:
> Add support to cygwin_internal() for setting a cygthread name and getting or setting a pthread name.  Also add support for getting the internal i/o handle for a given file descriptor.

Can you please break the log message in lines <= 72 chars?

> @@ -710,6 +743,14 @@ cygwin_internal (cygwin_getinfo_types t, ...)
>  	}
>  	break;
>  
> +      case CW_GET_IO_HANDLE_FROM_FD:
> +	{
> +	  int fd = va_arg(arg, int);
> +	  fhandler_base *fh = cygheap->fdtab[fd];
> +	  res = (uintptr_t) (fh->get_io_handle ());
> +	}
> +	break;
> +
>        default:
>  	set_errno (ENOSYS);
>      }

Nope, we won't do that.  The functionality is already available via
_get_osfhandle included via <io.h>.

Also, note that this is, and always will be a kludge.  There are
scenarios in which more than one handle is attached to a descriptor
(e.g., ptys) and the function will return only one.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Attachment: signature.asc
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]