Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
unique_fd.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "flutter/fml/unique_fd.h"
6
7#include "flutter/fml/eintr_wrapper.h"
8
9namespace fml {
10namespace internal {
11
12#if FML_OS_WIN
13
14namespace os_win {
15
16std::mutex UniqueFDTraits::file_map_mutex;
17std::map<HANDLE, DirCacheEntry> UniqueFDTraits::file_map;
18
19void UniqueFDTraits::Free_Handle(HANDLE fd) {
20 CloseHandle(fd);
21}
22
23} // namespace os_win
24
25#else // FML_OS_WIN
26
27namespace os_unix {
28
30 close(fd);
31}
32
33void UniqueDirTraits::Free(DIR* dir) {
34 closedir(dir);
35}
36
37} // namespace os_unix
38
39#endif // FML_OS_WIN
40
41} // namespace internal
42} // namespace fml
void * HANDLE