On Mon, May 4, 2009 at 11:06 AM, Adam Langley wrote:
> 2009/5/4 Darin Fisher :
> > Maybe we can reuse MakeTuple and DispatchToFunction from base/tuple.h ?
> > -Darin
>
> I started looking at this, but it ends up being a fair amount of
> template magic to deal with a situation which hasn't ever ac
2009/5/4 Darin Fisher :
> Maybe we can reuse MakeTuple and DispatchToFunction from base/tuple.h ?
> -Darin
I started looking at this, but it ends up being a fair amount of
template magic to deal with a situation which hasn't ever actually
happened in the code (even without the macro, where it wou
On Fri, May 1, 2009 at 1:46 PM, Albert J. Wong (王重傑) wrote:
> On Fri, May 1, 2009 at 1:31 PM, Jeremy Orlow wrote:
>
>> On Fri, May 1, 2009 at 1:27 PM, Adam Langley wrote:
>>
>>> On Fri, May 1, 2009 at 12:53 PM, Jeremy Orlow wrote:
>>> > I'm still kind of new here, so forgive me if this is a sil
On Fri, May 1, 2009 at 1:31 PM, Jeremy Orlow wrote:
> On Fri, May 1, 2009 at 1:27 PM, Adam Langley wrote:
>
>> On Fri, May 1, 2009 at 12:53 PM, Jeremy Orlow wrote:
>> > I'm still kind of new here, so forgive me if this is a silly question,
>> but
>> > why do this with a define and not an templa
What about NewRunnableFunction() in task.h? Slightly overkill because
of heap usage and parameter copy but it is quite strict.
It also requires writing the call in a different and less obvious way,
which may counter the benefit.
M-A
On Fri, May 1, 2009 at 4:39 PM, Adam Langley wrote:
>
> On Fr
On Fri, May 1, 2009 at 1:30 PM, Adam Langley wrote:
> On Fri, May 1, 2009 at 1:23 PM, Mike Belshe wrote:
> > It's been a while since I dealt with unix signals; but in the work I did,
> > the common trick was to disable signals on all threads except one. Then,
> > you only have to deal with hand
On Fri, May 1, 2009 at 1:32 PM, Adam Barth wrote:
> There's also a problem if you write something like:
>
> HANDLE_EINTR(close(PromptUserForFileDescriptor()));
>
> Macros suck.
>
> What about something like base::close that's inline and knows how to loop?
Yea, the macro will trigger multiple eva
There's also a problem if you write something like:
HANDLE_EINTR(close(PromptUserForFileDescriptor()));
Macros suck.
What about something like base::close that's inline and knows how to loop?
Adam
On Fri, May 1, 2009 at 1:27 PM, Adam Langley wrote:
> On Fri, May 1, 2009 at 1:13 PM, Elliot G
On Fri, May 1, 2009 at 1:27 PM, Adam Langley wrote:
> On Fri, May 1, 2009 at 12:53 PM, Jeremy Orlow wrote:
> > I'm still kind of new here, so forgive me if this is a silly question,
> but
> > why do this with a define and not an template function?
>
> One could imagine a template function:
>
> t
On Fri, May 1, 2009 at 1:23 PM, Mike Belshe wrote:
> It's been a while since I dealt with unix signals; but in the work I did,
> the common trick was to disable signals on all threads except one. Then,
> you only have to deal with handling signals there. Otherwise, you've pretty
> much always g
On Fri, May 1, 2009 at 1:13 PM, Elliot Glaysher (Chromium)
wrote:
> Yes. Regretfully, C doesn't have hygienic macros. It probably would be
> a good idea to change "ret" to a name less likely to conflict...
Yep, good point. It's now __eintr_result__.
Cheers
AGL
--~--~-~--~~---
On Fri, May 1, 2009 at 12:53 PM, Jeremy Orlow wrote:
> I'm still kind of new here, so forgive me if this is a silly question, but
> why do this with a define and not an template function?
One could imagine a template function:
template
T handle_eintr(T &a) {
..
}
But when using it as:
hand
It's been a while since I dealt with unix signals; but in the work I did,
the common trick was to disable signals on all threads except one. Then,
you only have to deal with handling signals there. Otherwise, you've pretty
much always got trouble because you never know which threads will service
On Fri, May 1, 2009 at 1:07 PM, Adam Barth wrote:
> Wow, that's pretty deep magic.
>
>> And you can use it like:
>> HANDLE_EINTR(close(fd));
>
> Isn't it disaster if you say:
>
> HANDLE_EINTR(close(ret));
Yes. Regretfully, C doesn't have hygienic macros. It probably would be
a good idea to chan
On Fri, May 1, 2009 at 12:35 PM, Adam Langley wrote:
> On POSIX, it uses GCC magic to return the correct type based on the expression
> and restarts the system call if it throws EINTR. Here it is:
>
> #define HANDLE_EINTR(x) ({ \
> typeof(x) ret; \
> do { \
> ret = x; \
> } while (ret == -1
I'm still kind of new here, so forgive me if this is a silly question, but
why do this with a define and not an template function?
On Fri, May 1, 2009 at 12:35 PM, Adam Langley wrote:
>
> On POSIX systems, system calls can be interrupted by signals. In this case,
> they'll return EINTR, indicati
16 matches
Mail list logo