On Thu, 2021-07-29 at 11:45 -0700, Ian Lance Taylor wrote:
> > Should this be "unspecified" rather than "undefined"?
>
> The general concern here is that if there is something like a file
> descriptor involved, and if the Close method doesn't take special
> protection to avoid problems with multiple calls to Close, then a
> first call to Close may close the descriptor, then some other
> goroutine may open something and get the same descriptor number, and
> then a second call to Close may close the same descriptor number,
> breaking the other goroutine unexpectedly.  Historically, we forgot
> to
> say that it was OK to call Close multiple times.  By the time we
> wrote
> that comment, there were many existing Close implementations out
> there, and it wasn't clear that we wanted to, or reasonably could,
> make them non-compliant.  So unfortunately I think we kind of do mean
> "undefined".

Yeah, fair enough. The leakage to other goroutines definitely justifies
the undefined wording.

Dan


-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/6671249cc777143f0de2c7eff6fe687bd348fb8a.camel%40kortschak.io.

Reply via email to