This implementation of bidirectional stream copy has the right behavior for closing streams. The first stream to return io.EOF
as a reader triggers a close on the second stream, and then the bidirectional copy may be considered done. The close on the second stream should trigger an error (e.g. io.EOF
) on the read of the first stream, closing that stream too.
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
/*!************************************************************* | |
* | |
* Firebug Lite 1.4.0a1 | |
* | |
* Copyright (c) 2007, Parakey Inc. | |
* Released under BSD license. | |
* More information: http://getfirebug.com/firebuglite | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
../osdep/win32-console-wrapper.c:22:6: warning: no previous prototype for 'cr_perror' [-Wmissing-prototypes] | |
void cr_perror(const wchar_t *prefix) | |
^~~~~~~~~ | |
../osdep/win32-console-wrapper.c:37:5: warning: no previous prototype for 'cr_runproc' [-Wmissing-prototypes] | |
int cr_runproc(wchar_t *name, wchar_t *cmdline) | |
^~~~~~~~~~ | |
../osdep/win32-console-wrapper.c:73:5: warning: no previous prototype for 'wmain' [-Wmissing-prototypes] | |
int wmain(int argc, wchar_t **argv, wchar_t **envp) | |
^~~~~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package multilock | |
import ( | |
"context" | |
) | |
// Resource represents a pool that, when drained, locks until a corresponding | |
// unlock is called. | |
type Resource struct { | |
c chan struct{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "io" | |
type channelReader struct { | |
c chan []byte | |
b []byte | |
} | |
func NewChannelReader(c chan []byte) io.Reader { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Windows.h> | |
int _tmain(int argc, _TCHAR* argv[]) | |
{ | |
HANDLE hToken; | |
OpenProcessToken(GetCurrentProcess(), | |
TOKEN_ADJUST_PRIVILEGES | | |
TOKEN_QUERY, | |
&hToken); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "sync" | |
type ExitGroup struct { | |
wg sync.WaitGroup | |
cl []func() | |
lk sync.Mutex | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// dllmain.cpp : Defines the entry point for the DLL application. | |
#include "volumemonitor.h" | |
// We use a worker thread for all COM calls, since CoInitialize is not | |
// otherwise safe to execute in a DLL. | |
HANDLE worker_thread_; | |
// There is one global VolumeMonitor that is lazy-loaded. This helps us | |
// report errors on initialization, and will also re-attempt initialization | |
// at the next call. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self = | |
{ | |
header: "Header", | |
header2: "Header2", | |
header3: "Header3", | |
header4: "Header4", | |
header5: "Header5", | |
header6: "Header6", | |
list: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* Jade | |
* Copyright(c) 2010 TJ Holowaychuk <tj@vision-media.ca> | |
* MIT Licensed | |
*/ | |
/** | |
* Module dependencies. | |
*/ |
NewerOlder