<!DOCTYPE html>
<html lang="vi" data-theme="auto">
<head>

<link rel="preconnect" href="https://www.googletagmanager.com">
<script >(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
  new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
  j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
  'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
  })(window,document,'script','dataLayer','GTM-W8MVQXG');</script>
  
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#00add8">
<link rel="canonical" href="https://go.dev/src/runtime/cgo/gcc_libinit.c">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Material+Icons">
<link rel="stylesheet" href="/css/styles.css">
<link rel="icon" href="/images/favicon-gopher.png" sizes="any">
<link rel="apple-touch-icon" href="/images/favicon-gopher-plain.png"/>
<link rel="icon" href="/images/favicon-gopher.svg" type="image/svg+xml">
<link rel="me" href="https://hachyderm.io/@golang">

  
  <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
  new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
  j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
  'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
  })(window,document,'script','dataLayer','GTM-W8MVQXG');</script>
  
<script src="/js/site.js"></script>
<meta name="og:url" content="https://go.dev/src/runtime/cgo/gcc_libinit.c">
<meta name="og:title" content=" - The Go Programming Language">
<title> - The Go Programming Language</title>

<meta name="og:image" content="https://go.dev/doc/gopher/gopher5logo.jpg">
<meta name="twitter:image" content="https://go.dev/doc/gopher/gopherbelly300.jpg">
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@golang">
</head>
<body class="Site">
  
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-W8MVQXG"
  height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
  


<header class="Site-header js-siteHeader">
  <div class="Header Header--dark">
    <nav class="Header-nav">
      <a href="/">
        <img
          class="js-headerLogo Header-logo"
          src="/images/go-logo-white.svg"
          alt="Go">
      </a>
      <div class="skip-navigation-wrapper">
        <a class="skip-to-content-link" aria-label="Bỏ qua để đến nội dung chính" href="#main-content"> Bỏ qua đến nội dung chính </a>
      </div>
      <div class="Header-rightContent">
        <ul class="Header-menu">
          <li class="Header-menuItem ">
            <a href="#"  class="js-desktop-menu-hover" aria-label=Tại&#32;sao&#32;Go aria-describedby="dropdown-description">
              Tại sao Go <i class="material-icons" aria-hidden="true">arrow_drop_down</i>
            </a>
            <div class="screen-reader-only" id="dropdown-description" hidden>
              Nhấn Enter để bật/tắt menu thả xuống
            </div>
              <ul class="Header-submenu js-desktop-submenu-hover" aria-label="submenu">
                  <li class="Header-submenuItem">
                    <div>
                        <a href="/solutions/case-studies">
                          Case Studies
                          
                        </a>
                    </div>
                    <p>Các vấn đề phổ biến mà doanh nghiệp giải quyết bằng Go</p>
                  </li>
                  <li class="Header-submenuItem">
                    <div>
                        <a href="/solutions/use-cases">
                          Use Cases
                          
                        </a>
                    </div>
                    <p>Câu chuyện về cách thức và lý do các công ty sử dụng Go</p>
                  </li>
                  <li class="Header-submenuItem">
                    <div>
                        <a href="/security/">
                          Bảo mật
                          
                        </a>
                    </div>
                    <p>Go giúp bạn bảo mật theo mặc định như thế nào</p>
                  </li>
              </ul>
          </li>
          <li class="Header-menuItem ">
            <a href="/learn/"  aria-label=Học aria-describedby="dropdown-description">
              Học 
            </a>
            <div class="screen-reader-only" id="dropdown-description" hidden>
              Nhấn Enter để bật/tắt menu thả xuống
            </div>
          </li>
          <li class="Header-menuItem ">
            <a href="#"  class="js-desktop-menu-hover" aria-label=Tài&#32;liệu aria-describedby="dropdown-description">
              Tài liệu <i class="material-icons" aria-hidden="true">arrow_drop_down</i>
            </a>
            <div class="screen-reader-only" id="dropdown-description" hidden>
              Nhấn Enter để bật/tắt menu thả xuống
            </div>
              <ul class="Header-submenu js-desktop-submenu-hover" aria-label="submenu">
                  <li class="Header-submenuItem">
                    <div>
                        <a href="/ref/spec">
                          Go Spec
                          
                        </a>
                    </div>
                    <p>Đặc tả ngôn ngữ Go chính thức</p>
                  </li>
                  <li class="Header-submenuItem">
                    <div>
                        <a href="/doc">
                          Hướng dẫn sử dụng Go
                          
                        </a>
                    </div>
                    <p>Giới thiệu đầy đủ về cách xây dựng phần mềm với Go</p>
                  </li>
                  <li class="Header-submenuItem">
                    <div>
                        <a href="https://pkg.go.dev/std">
                          Thư viện chuẩn
                          
                        </a>
                    </div>
                    <p>Tài liệu tham chiếu cho thư viện chuẩn của Go</p>
                  </li>
                  <li class="Header-submenuItem">
                    <div>
                        <a href="/doc/devel/release">
                          Ghi chú bản phát hành
                          
                        </a>
                    </div>
                    <p>Tìm hiểu những điểm mới trong từng bản phát hành Go</p>
                  </li>
                  <li class="Header-submenuItem">
                    <div>
                        <a href="/doc/effective_go">
                          Effective Go
                          
                        </a>
                    </div>
                    <p>Mẹo viết code Go rõ ràng, hiệu quả và đúng phong cách</p>
                  </li>
              </ul>
          </li>
          <li class="Header-menuItem ">
            <a href="https://pkg.go.dev"  aria-label=Packages aria-describedby="dropdown-description">
              Packages 
            </a>
            <div class="screen-reader-only" id="dropdown-description" hidden>
              Nhấn Enter để bật/tắt menu thả xuống
            </div>
          </li>
          <li class="Header-menuItem ">
            <a href="#"  class="js-desktop-menu-hover" aria-label=Cộng&#32;đồng aria-describedby="dropdown-description">
              Cộng đồng <i class="material-icons" aria-hidden="true">arrow_drop_down</i>
            </a>
            <div class="screen-reader-only" id="dropdown-description" hidden>
              Nhấn Enter để bật/tắt menu thả xuống
            </div>
              <ul class="Header-submenu js-desktop-submenu-hover" aria-label="submenu">
                  <li class="Header-submenuItem">
                    <div>
                        <a href="/talks/">
                          Recorded Talks
                          
                        </a>
                    </div>
                    <p>Video từ các sự kiện trước đây</p>
                  </li>
                  <li class="Header-submenuItem">
                    <div>
                        <a href="https://www.meetup.com/pro/go">
                          Meetups
                           <i class="material-icons">open_in_new</i>
                        </a>
                    </div>
                    <p>Gặp gỡ các lập trình viên Go địa phương khác</p>
                  </li>
                  <li class="Header-submenuItem">
                    <div>
                        <a href="/wiki/Conferences">
                          Hội nghị
                           <i class="material-icons">open_in_new</i>
                        </a>
                    </div>
                    <p>Học hỏi và kết nối với các lập trình viên Go trên toàn thế giới</p>
                  </li>
                  <li class="Header-submenuItem">
                    <div>
                        <a href="/blog">
                          Go blog
                          
                        </a>
                    </div>
                    <p>Blog chính thức của dự án Go.</p>
                  </li>
                  <li class="Header-submenuItem">
                    <div>
                        <a href="/help">
                          Dự án Go
                          
                        </a>
                    </div>
                    <p>Nhận trợ giúp và cập nhật thông tin từ Go</p>
                  </li>
                  <li class="Header-submenuItem">
                    <div>
                        Kết nối
                    </div>
                    <p></p>
                      <div class="Header-socialIcons">
                        
                        <a class="Header-socialIcon" aria-label="Kết nối qua google-groups (Mở trong cửa sổ mới)" href="https://groups.google.com/g/golang-nuts"><img src="/images/logos/social/google-groups.svg" /></a>
                        <a class="Header-socialIcon" aria-label="Kết nối qua github (Mở trong cửa sổ mới)" href="https://github.com/golang"><img src="/images/logos/social/github.svg" /></a>
                        <a class="Header-socialIcon" aria-label="Kết nối qua bluesky (Mở trong cửa sổ mới)" href="https://bsky.app/profile/golang.org"><img src="/images/logos/social/bluesky.svg" /></a>
                        <a class="Header-socialIcon" aria-label="Kết nối qua mastodon (Mở trong cửa sổ mới)" href="https://hachyderm.io/@golang"><img src="/images/logos/social/mastodon.svg" /></a>
                        <a class="Header-socialIcon" aria-label="Kết nối qua twitter (Mở trong cửa sổ mới)" href="https://twitter.com/golang"><img src="/images/logos/social/twitter.svg" /></a>
                        <a class="Header-socialIcon" aria-label="Kết nối qua reddit (Mở trong cửa sổ mới)" href="https://www.reddit.com/r/golang/"><img src="/images/logos/social/reddit.svg" /></a>
                        <a class="Header-socialIcon" aria-label="Kết nối qua slack (Mở trong cửa sổ mới)" href="https://invite.slack.golangbridge.org/"><img src="/images/logos/social/slack.svg" /></a>
                        <a class="Header-socialIcon" aria-label="Kết nối qua stack-overflow (Mở trong cửa sổ mới)" href="https://stackoverflow.com/tags/go"><img src="/images/logos/social/stack-overflow.svg" /></a>
                      </div>
                  </li>
              </ul>
          </li>
        </ul>
        <button class="Header-navOpen js-headerMenuButton Header-navOpen--white" aria-label="Mở điều hướng.">
        </button>
      </div>
    </nav>
    
  </div>
</header>
<aside class="NavigationDrawer js-header">
  <nav class="NavigationDrawer-nav">
    <div class="NavigationDrawer-header">
      <a href="/">
        <img class="NavigationDrawer-logo" src="/images/go-logo-blue.svg" alt="Go.">
      </a>
    </div>
    <ul class="NavigationDrawer-list">
        
          <li class="NavigationDrawer-listItem js-mobile-subnav-trigger  NavigationDrawer-hasSubnav">
            <a href="#"><span>Tại sao Go</span> <i class="material-icons">navigate_next</i></a>

            <div class="NavigationDrawer NavigationDrawer-submenuItem">
              <nav class="NavigationDrawer-nav">
                <div class="NavigationDrawer-header">
                  <a href="#"><i class="material-icons">navigate_before</i>Tại sao Go</a>
                </div>
                <ul class="NavigationDrawer-list">
                    <li class="NavigationDrawer-listItem">
                        <a href="/solutions/case-studies">
                          Case Studies
                          
                        </a>
                      
                    </li>
                    <li class="NavigationDrawer-listItem">
                        <a href="/solutions/use-cases">
                          Use Cases
                          
                        </a>
                      
                    </li>
                    <li class="NavigationDrawer-listItem">
                        <a href="/security/">
                          Bảo mật
                          
                        </a>
                      
                    </li>
                </ul>
              </div>
            </div>
          </li>

        
        
          <li class="NavigationDrawer-listItem ">
            <a href="/learn/">Học</a>
          </li>
        
        
          <li class="NavigationDrawer-listItem js-mobile-subnav-trigger  NavigationDrawer-hasSubnav">
            <a href="#"><span>Tài liệu</span> <i class="material-icons">navigate_next</i></a>

            <div class="NavigationDrawer NavigationDrawer-submenuItem">
              <nav class="NavigationDrawer-nav">
                <div class="NavigationDrawer-header">
                  <a href="#"><i class="material-icons">navigate_before</i>Tài liệu</a>
                </div>
                <ul class="NavigationDrawer-list">
                    <li class="NavigationDrawer-listItem">
                        <a href="/ref/spec">
                          Go Spec
                          
                        </a>
                      
                    </li>
                    <li class="NavigationDrawer-listItem">
                        <a href="/doc">
                          Hướng dẫn sử dụng Go
                          
                        </a>
                      
                    </li>
                    <li class="NavigationDrawer-listItem">
                        <a href="https://pkg.go.dev/std">
                          Thư viện chuẩn
                          
                        </a>
                      
                    </li>
                    <li class="NavigationDrawer-listItem">
                        <a href="/doc/devel/release">
                          Ghi chú bản phát hành
                          
                        </a>
                      
                    </li>
                    <li class="NavigationDrawer-listItem">
                        <a href="/doc/effective_go">
                          Effective Go
                          
                        </a>
                      
                    </li>
                </ul>
              </div>
            </div>
          </li>

        
        
          <li class="NavigationDrawer-listItem ">
            <a href="https://pkg.go.dev">Packages</a>
          </li>
        
        
          <li class="NavigationDrawer-listItem js-mobile-subnav-trigger  NavigationDrawer-hasSubnav">
            <a href="#"><span>Cộng đồng</span> <i class="material-icons">navigate_next</i></a>

            <div class="NavigationDrawer NavigationDrawer-submenuItem">
              <nav class="NavigationDrawer-nav">
                <div class="NavigationDrawer-header">
                  <a href="#"><i class="material-icons">navigate_before</i>Cộng đồng</a>
                </div>
                <ul class="NavigationDrawer-list">
                    <li class="NavigationDrawer-listItem">
                        <a href="/talks/">
                          Recorded Talks
                          
                        </a>
                      
                    </li>
                    <li class="NavigationDrawer-listItem">
                        <a href="https://www.meetup.com/pro/go">
                          Meetups
                           <i class="material-icons">open_in_new</i>
                        </a>
                      
                    </li>
                    <li class="NavigationDrawer-listItem">
                        <a href="/wiki/Conferences">
                          Hội nghị
                           <i class="material-icons">open_in_new</i>
                        </a>
                      
                    </li>
                    <li class="NavigationDrawer-listItem">
                        <a href="/blog">
                          Go blog
                          
                        </a>
                      
                    </li>
                    <li class="NavigationDrawer-listItem">
                        <a href="/help">
                          Dự án Go
                          
                        </a>
                      
                    </li>
                    <li class="NavigationDrawer-listItem">
                        <div>Kết nối</div>
                        <div class="Header-socialIcons">
                          
                            <a class="Header-socialIcon" href="https://groups.google.com/g/golang-nuts"><img src="/images/logos/social/google-groups.svg" /></a>
                            <a class="Header-socialIcon" href="https://github.com/golang"><img src="/images/logos/social/github.svg" /></a>
                            <a class="Header-socialIcon" href="https://bsky.app/profile/golang.org"><img src="/images/logos/social/bluesky.svg" /></a>
                            <a class="Header-socialIcon" href="https://hachyderm.io/@golang"><img src="/images/logos/social/mastodon.svg" /></a>
                            <a class="Header-socialIcon" href="https://twitter.com/golang"><img src="/images/logos/social/twitter.svg" /></a>
                            <a class="Header-socialIcon" href="https://www.reddit.com/r/golang/"><img src="/images/logos/social/reddit.svg" /></a>
                            <a class="Header-socialIcon" href="https://invite.slack.golangbridge.org/"><img src="/images/logos/social/slack.svg" /></a>
                            <a class="Header-socialIcon" href="https://stackoverflow.com/tags/go"><img src="/images/logos/social/stack-overflow.svg" /></a>
                        </div>
                    </li>
                </ul>
              </div>
            </div>
          </li>

        
    </ul>
  </nav>
</aside>
<div class="NavigationDrawer-scrim js-scrim" role="presentation"></div>
<main class="SiteContent SiteContent--default" id="main-content">
  

<article class="Texthtml Article">


<h1>Tệp văn bản 


<a href="/src/">src</a>/<a href="/src/runtime/">runtime</a>/<a href="/src/runtime/cgo/">cgo</a>/<span class="text-muted">gcc_libinit.c</span>
</h1>


<pre><span id="L1" class="ln">     1&nbsp;&nbsp;</span>// Copyright 2015 The Go Authors. All rights reserved.
<span id="L2" class="ln">     2&nbsp;&nbsp;</span>// Use of this source code is governed by a BSD-style
<span id="L3" class="ln">     3&nbsp;&nbsp;</span>// license that can be found in the LICENSE file.
<span id="L4" class="ln">     4&nbsp;&nbsp;</span>
<span id="L5" class="ln">     5&nbsp;&nbsp;</span>//go:build unix
<span id="L6" class="ln">     6&nbsp;&nbsp;</span>
<span id="L7" class="ln">     7&nbsp;&nbsp;</span>// When cross-compiling with clang to linux/armv5, atomics are emulated
<span id="L8" class="ln">     8&nbsp;&nbsp;</span>// and cause a compiler warning. This results in a build failure since
<span id="L9" class="ln">     9&nbsp;&nbsp;</span>// cgo uses -Werror. See #65290.
<span id="L10" class="ln">    10&nbsp;&nbsp;</span>#pragma GCC diagnostic ignored &#34;-Wpragmas&#34;
<span id="L11" class="ln">    11&nbsp;&nbsp;</span>#pragma GCC diagnostic ignored &#34;-Wunknown-warning-option&#34;
<span id="L12" class="ln">    12&nbsp;&nbsp;</span>#pragma GCC diagnostic ignored &#34;-Watomic-alignment&#34;
<span id="L13" class="ln">    13&nbsp;&nbsp;</span>
<span id="L14" class="ln">    14&nbsp;&nbsp;</span>#include &lt;pthread.h&gt;
<span id="L15" class="ln">    15&nbsp;&nbsp;</span>#include &lt;errno.h&gt;
<span id="L16" class="ln">    16&nbsp;&nbsp;</span>#include &lt;stdio.h&gt;
<span id="L17" class="ln">    17&nbsp;&nbsp;</span>#include &lt;stdlib.h&gt;
<span id="L18" class="ln">    18&nbsp;&nbsp;</span>#include &lt;string.h&gt; // strerror
<span id="L19" class="ln">    19&nbsp;&nbsp;</span>#include &lt;time.h&gt;
<span id="L20" class="ln">    20&nbsp;&nbsp;</span>#include &#34;libcgo.h&#34;
<span id="L21" class="ln">    21&nbsp;&nbsp;</span>#include &#34;libcgo_unix.h&#34;
<span id="L22" class="ln">    22&nbsp;&nbsp;</span>
<span id="L23" class="ln">    23&nbsp;&nbsp;</span>static pthread_cond_t runtime_init_cond = PTHREAD_COND_INITIALIZER;
<span id="L24" class="ln">    24&nbsp;&nbsp;</span>static pthread_mutex_t runtime_init_mu = PTHREAD_MUTEX_INITIALIZER;
<span id="L25" class="ln">    25&nbsp;&nbsp;</span>static int runtime_init_done;
<span id="L26" class="ln">    26&nbsp;&nbsp;</span>
<span id="L27" class="ln">    27&nbsp;&nbsp;</span>// pthread_g is a pthread specific key, for storing the g that binded to the C thread.
<span id="L28" class="ln">    28&nbsp;&nbsp;</span>// The registered pthread_key_destructor will dropm, when the pthread-specified value g is not NULL,
<span id="L29" class="ln">    29&nbsp;&nbsp;</span>// while a C thread is exiting.
<span id="L30" class="ln">    30&nbsp;&nbsp;</span>static pthread_key_t pthread_g;
<span id="L31" class="ln">    31&nbsp;&nbsp;</span>static void pthread_key_destructor(void* g);
<span id="L32" class="ln">    32&nbsp;&nbsp;</span>uintptr_t x_cgo_pthread_key_created;
<span id="L33" class="ln">    33&nbsp;&nbsp;</span>void (*x_crosscall2_ptr)(void (*fn)(void *), void *, int, size_t);
<span id="L34" class="ln">    34&nbsp;&nbsp;</span>
<span id="L35" class="ln">    35&nbsp;&nbsp;</span>// The traceback function, used when tracing C calls.
<span id="L36" class="ln">    36&nbsp;&nbsp;</span>static void (*cgo_traceback_function)(struct cgoTracebackArg*);
<span id="L37" class="ln">    37&nbsp;&nbsp;</span>
<span id="L38" class="ln">    38&nbsp;&nbsp;</span>// The context function, used when tracing back C calls into Go.
<span id="L39" class="ln">    39&nbsp;&nbsp;</span>static void (*cgo_context_function)(struct cgoContextArg*);
<span id="L40" class="ln">    40&nbsp;&nbsp;</span>
<span id="L41" class="ln">    41&nbsp;&nbsp;</span>// The symbolizer function, used when symbolizing C frames.
<span id="L42" class="ln">    42&nbsp;&nbsp;</span>static void (*cgo_symbolizer_function)(struct cgoSymbolizerArg*);
<span id="L43" class="ln">    43&nbsp;&nbsp;</span>
<span id="L44" class="ln">    44&nbsp;&nbsp;</span>void
<span id="L45" class="ln">    45&nbsp;&nbsp;</span>x_cgo_sys_thread_create(void* (*func)(void*), void* arg) {
<span id="L46" class="ln">    46&nbsp;&nbsp;</span>	pthread_attr_t attr;
<span id="L47" class="ln">    47&nbsp;&nbsp;</span>	pthread_t p;
<span id="L48" class="ln">    48&nbsp;&nbsp;</span>	int err;
<span id="L49" class="ln">    49&nbsp;&nbsp;</span>
<span id="L50" class="ln">    50&nbsp;&nbsp;</span>	pthread_attr_init(&amp;attr);
<span id="L51" class="ln">    51&nbsp;&nbsp;</span>	pthread_attr_setdetachstate(&amp;attr, PTHREAD_CREATE_DETACHED);
<span id="L52" class="ln">    52&nbsp;&nbsp;</span>	err = _cgo_try_pthread_create(&amp;p, &amp;attr, func, arg);
<span id="L53" class="ln">    53&nbsp;&nbsp;</span>	if (err != 0) {
<span id="L54" class="ln">    54&nbsp;&nbsp;</span>		fprintf(stderr, &#34;pthread_create failed: %s&#34;, strerror(err));
<span id="L55" class="ln">    55&nbsp;&nbsp;</span>		abort();
<span id="L56" class="ln">    56&nbsp;&nbsp;</span>	}
<span id="L57" class="ln">    57&nbsp;&nbsp;</span>}
<span id="L58" class="ln">    58&nbsp;&nbsp;</span>
<span id="L59" class="ln">    59&nbsp;&nbsp;</span>uintptr_t
<span id="L60" class="ln">    60&nbsp;&nbsp;</span>_cgo_wait_runtime_init_done(void) {
<span id="L61" class="ln">    61&nbsp;&nbsp;</span>	void (*pfn)(struct cgoContextArg*);
<span id="L62" class="ln">    62&nbsp;&nbsp;</span>	int done;
<span id="L63" class="ln">    63&nbsp;&nbsp;</span>
<span id="L64" class="ln">    64&nbsp;&nbsp;</span>	pfn = __atomic_load_n(&amp;cgo_context_function, __ATOMIC_CONSUME);
<span id="L65" class="ln">    65&nbsp;&nbsp;</span>
<span id="L66" class="ln">    66&nbsp;&nbsp;</span>	done = 2;
<span id="L67" class="ln">    67&nbsp;&nbsp;</span>	if (__atomic_load_n(&amp;runtime_init_done, __ATOMIC_CONSUME) != done) {
<span id="L68" class="ln">    68&nbsp;&nbsp;</span>		pthread_mutex_lock(&amp;runtime_init_mu);
<span id="L69" class="ln">    69&nbsp;&nbsp;</span>		while (__atomic_load_n(&amp;runtime_init_done, __ATOMIC_CONSUME) == 0) {
<span id="L70" class="ln">    70&nbsp;&nbsp;</span>			pthread_cond_wait(&amp;runtime_init_cond, &amp;runtime_init_mu);
<span id="L71" class="ln">    71&nbsp;&nbsp;</span>		}
<span id="L72" class="ln">    72&nbsp;&nbsp;</span>
<span id="L73" class="ln">    73&nbsp;&nbsp;</span>		// The key and x_cgo_pthread_key_created are for the whole program,
<span id="L74" class="ln">    74&nbsp;&nbsp;</span>		// whereas the specific and destructor is per thread.
<span id="L75" class="ln">    75&nbsp;&nbsp;</span>		if (x_cgo_pthread_key_created == 0 &amp;&amp; pthread_key_create(&amp;pthread_g, pthread_key_destructor) == 0) {
<span id="L76" class="ln">    76&nbsp;&nbsp;</span>			x_cgo_pthread_key_created = 1;
<span id="L77" class="ln">    77&nbsp;&nbsp;</span>		}
<span id="L78" class="ln">    78&nbsp;&nbsp;</span>
<span id="L79" class="ln">    79&nbsp;&nbsp;</span>		// TODO(iant): For the case of a new C thread calling into Go, such
<span id="L80" class="ln">    80&nbsp;&nbsp;</span>		// as when using -buildmode=c-archive, we know that Go runtime
<span id="L81" class="ln">    81&nbsp;&nbsp;</span>		// initialization is complete but we do not know that all Go init
<span id="L82" class="ln">    82&nbsp;&nbsp;</span>		// functions have been run. We should not fetch cgo_context_function
<span id="L83" class="ln">    83&nbsp;&nbsp;</span>		// until they have been, because that is where a call to
<span id="L84" class="ln">    84&nbsp;&nbsp;</span>		// SetCgoTraceback is likely to occur. We are going to wait for Go
<span id="L85" class="ln">    85&nbsp;&nbsp;</span>		// initialization to be complete anyhow, later, by waiting for
<span id="L86" class="ln">    86&nbsp;&nbsp;</span>		// main_init_done to be closed in cgocallbackg1. We should wait here
<span id="L87" class="ln">    87&nbsp;&nbsp;</span>		// instead. See also issue #15943.
<span id="L88" class="ln">    88&nbsp;&nbsp;</span>		pfn = __atomic_load_n(&amp;cgo_context_function, __ATOMIC_CONSUME);
<span id="L89" class="ln">    89&nbsp;&nbsp;</span>
<span id="L90" class="ln">    90&nbsp;&nbsp;</span>		__atomic_store_n(&amp;runtime_init_done, done, __ATOMIC_RELEASE);
<span id="L91" class="ln">    91&nbsp;&nbsp;</span>		pthread_mutex_unlock(&amp;runtime_init_mu);
<span id="L92" class="ln">    92&nbsp;&nbsp;</span>	}
<span id="L93" class="ln">    93&nbsp;&nbsp;</span>
<span id="L94" class="ln">    94&nbsp;&nbsp;</span>	if (pfn != nil) {
<span id="L95" class="ln">    95&nbsp;&nbsp;</span>		struct cgoContextArg arg;
<span id="L96" class="ln">    96&nbsp;&nbsp;</span>
<span id="L97" class="ln">    97&nbsp;&nbsp;</span>		arg.Context = 0;
<span id="L98" class="ln">    98&nbsp;&nbsp;</span>		(*pfn)(&amp;arg);
<span id="L99" class="ln">    99&nbsp;&nbsp;</span>		return arg.Context;
<span id="L100" class="ln">   100&nbsp;&nbsp;</span>	}
<span id="L101" class="ln">   101&nbsp;&nbsp;</span>	return 0;
<span id="L102" class="ln">   102&nbsp;&nbsp;</span>}
<span id="L103" class="ln">   103&nbsp;&nbsp;</span>
<span id="L104" class="ln">   104&nbsp;&nbsp;</span>// _cgo_set_stacklo sets g-&gt;stacklo based on the stack size.
<span id="L105" class="ln">   105&nbsp;&nbsp;</span>// This is common code called from x_cgo_init, which is itself
<span id="L106" class="ln">   106&nbsp;&nbsp;</span>// called by rt0_go in the runtime package.
<span id="L107" class="ln">   107&nbsp;&nbsp;</span>void _cgo_set_stacklo(G *g, uintptr *pbounds)
<span id="L108" class="ln">   108&nbsp;&nbsp;</span>{
<span id="L109" class="ln">   109&nbsp;&nbsp;</span>	uintptr bounds[2];
<span id="L110" class="ln">   110&nbsp;&nbsp;</span>
<span id="L111" class="ln">   111&nbsp;&nbsp;</span>	// pbounds can be passed in by the caller; see gcc_linux_amd64.c.
<span id="L112" class="ln">   112&nbsp;&nbsp;</span>	if (pbounds == NULL) {
<span id="L113" class="ln">   113&nbsp;&nbsp;</span>		pbounds = &amp;bounds[0];
<span id="L114" class="ln">   114&nbsp;&nbsp;</span>	}
<span id="L115" class="ln">   115&nbsp;&nbsp;</span>
<span id="L116" class="ln">   116&nbsp;&nbsp;</span>	x_cgo_getstackbound(pbounds);
<span id="L117" class="ln">   117&nbsp;&nbsp;</span>
<span id="L118" class="ln">   118&nbsp;&nbsp;</span>	g-&gt;stacklo = *pbounds;
<span id="L119" class="ln">   119&nbsp;&nbsp;</span>
<span id="L120" class="ln">   120&nbsp;&nbsp;</span>	// Sanity check the results now, rather than getting a
<span id="L121" class="ln">   121&nbsp;&nbsp;</span>	// morestack on g0 crash.
<span id="L122" class="ln">   122&nbsp;&nbsp;</span>	if (g-&gt;stacklo &gt;= g-&gt;stackhi) {
<span id="L123" class="ln">   123&nbsp;&nbsp;</span>		fprintf(stderr, &#34;runtime/cgo: bad stack bounds: lo=%p hi=%p\n&#34;, (void*)(g-&gt;stacklo), (void*)(g-&gt;stackhi));
<span id="L124" class="ln">   124&nbsp;&nbsp;</span>		abort();
<span id="L125" class="ln">   125&nbsp;&nbsp;</span>	}
<span id="L126" class="ln">   126&nbsp;&nbsp;</span>}
<span id="L127" class="ln">   127&nbsp;&nbsp;</span>
<span id="L128" class="ln">   128&nbsp;&nbsp;</span>// Store the g into a thread-specific value associated with the pthread key pthread_g.
<span id="L129" class="ln">   129&nbsp;&nbsp;</span>// And pthread_key_destructor will dropm when the thread is exiting.
<span id="L130" class="ln">   130&nbsp;&nbsp;</span>void x_cgo_bindm(void* g) {
<span id="L131" class="ln">   131&nbsp;&nbsp;</span>	// We assume this will always succeed, otherwise, there might be extra M leaking,
<span id="L132" class="ln">   132&nbsp;&nbsp;</span>	// when a C thread exits after a cgo call.
<span id="L133" class="ln">   133&nbsp;&nbsp;</span>	// We only invoke this function once per thread in runtime.needAndBindM,
<span id="L134" class="ln">   134&nbsp;&nbsp;</span>	// and the next calls just reuse the bound m.
<span id="L135" class="ln">   135&nbsp;&nbsp;</span>	pthread_setspecific(pthread_g, g);
<span id="L136" class="ln">   136&nbsp;&nbsp;</span>}
<span id="L137" class="ln">   137&nbsp;&nbsp;</span>
<span id="L138" class="ln">   138&nbsp;&nbsp;</span>void
<span id="L139" class="ln">   139&nbsp;&nbsp;</span>x_cgo_notify_runtime_init_done(void* dummy __attribute__ ((unused))) {
<span id="L140" class="ln">   140&nbsp;&nbsp;</span>	pthread_mutex_lock(&amp;runtime_init_mu);
<span id="L141" class="ln">   141&nbsp;&nbsp;</span>	__atomic_store_n(&amp;runtime_init_done, 1, __ATOMIC_RELEASE);
<span id="L142" class="ln">   142&nbsp;&nbsp;</span>	pthread_cond_broadcast(&amp;runtime_init_cond);
<span id="L143" class="ln">   143&nbsp;&nbsp;</span>	pthread_mutex_unlock(&amp;runtime_init_mu);
<span id="L144" class="ln">   144&nbsp;&nbsp;</span>}
<span id="L145" class="ln">   145&nbsp;&nbsp;</span>
<span id="L146" class="ln">   146&nbsp;&nbsp;</span>// Sets the traceback, context, and symbolizer functions. Called from
<span id="L147" class="ln">   147&nbsp;&nbsp;</span>// runtime.SetCgoTraceback.
<span id="L148" class="ln">   148&nbsp;&nbsp;</span>void x_cgo_set_traceback_functions(struct cgoSetTracebackFunctionsArg* arg) {
<span id="L149" class="ln">   149&nbsp;&nbsp;</span>	__atomic_store_n(&amp;cgo_traceback_function, arg-&gt;Traceback, __ATOMIC_RELEASE);
<span id="L150" class="ln">   150&nbsp;&nbsp;</span>	__atomic_store_n(&amp;cgo_context_function, arg-&gt;Context, __ATOMIC_RELEASE);
<span id="L151" class="ln">   151&nbsp;&nbsp;</span>	__atomic_store_n(&amp;cgo_symbolizer_function, arg-&gt;Symbolizer, __ATOMIC_RELEASE);
<span id="L152" class="ln">   152&nbsp;&nbsp;</span>}
<span id="L153" class="ln">   153&nbsp;&nbsp;</span>
<span id="L154" class="ln">   154&nbsp;&nbsp;</span>// Gets the traceback function to call to trace C calls.
<span id="L155" class="ln">   155&nbsp;&nbsp;</span>void (*(_cgo_get_traceback_function(void)))(struct cgoTracebackArg*) {
<span id="L156" class="ln">   156&nbsp;&nbsp;</span>	return __atomic_load_n(&amp;cgo_traceback_function, __ATOMIC_CONSUME);
<span id="L157" class="ln">   157&nbsp;&nbsp;</span>}
<span id="L158" class="ln">   158&nbsp;&nbsp;</span>
<span id="L159" class="ln">   159&nbsp;&nbsp;</span>// Call the traceback function registered with x_cgo_set_traceback_functions.
<span id="L160" class="ln">   160&nbsp;&nbsp;</span>//
<span id="L161" class="ln">   161&nbsp;&nbsp;</span>// The traceback function is an arbitrary user C function which may be built
<span id="L162" class="ln">   162&nbsp;&nbsp;</span>// with TSAN, and thus must be wrapped with TSAN acquire/release calls. For
<span id="L163" class="ln">   163&nbsp;&nbsp;</span>// normal cgo calls, cmd/cgo automatically inserts TSAN acquire/release calls.
<span id="L164" class="ln">   164&nbsp;&nbsp;</span>// Since the traceback, context, and symbolizer functions are registered at
<span id="L165" class="ln">   165&nbsp;&nbsp;</span>// startup and called via the runtime, they do not get automatic TSAN
<span id="L166" class="ln">   166&nbsp;&nbsp;</span>// acquire/release calls.
<span id="L167" class="ln">   167&nbsp;&nbsp;</span>//
<span id="L168" class="ln">   168&nbsp;&nbsp;</span>// The only purpose of this wrapper is to perform TSAN acquire/release.
<span id="L169" class="ln">   169&nbsp;&nbsp;</span>// Alternatively, if the runtime arranged to safely call TSAN acquire/release,
<span id="L170" class="ln">   170&nbsp;&nbsp;</span>// it could perform the call directly.
<span id="L171" class="ln">   171&nbsp;&nbsp;</span>void x_cgo_call_traceback_function(struct cgoTracebackArg* arg) {
<span id="L172" class="ln">   172&nbsp;&nbsp;</span>	void (*pfn)(struct cgoTracebackArg*);
<span id="L173" class="ln">   173&nbsp;&nbsp;</span>
<span id="L174" class="ln">   174&nbsp;&nbsp;</span>	pfn = _cgo_get_traceback_function();
<span id="L175" class="ln">   175&nbsp;&nbsp;</span>	if (pfn == nil) {
<span id="L176" class="ln">   176&nbsp;&nbsp;</span>		return;
<span id="L177" class="ln">   177&nbsp;&nbsp;</span>	}
<span id="L178" class="ln">   178&nbsp;&nbsp;</span>
<span id="L179" class="ln">   179&nbsp;&nbsp;</span>	_cgo_tsan_acquire();
<span id="L180" class="ln">   180&nbsp;&nbsp;</span>	(*pfn)(arg);
<span id="L181" class="ln">   181&nbsp;&nbsp;</span>	_cgo_tsan_release();
<span id="L182" class="ln">   182&nbsp;&nbsp;</span>}
<span id="L183" class="ln">   183&nbsp;&nbsp;</span>
<span id="L184" class="ln">   184&nbsp;&nbsp;</span>// Gets the context function to call to record the traceback context
<span id="L185" class="ln">   185&nbsp;&nbsp;</span>// when calling a Go function from C code.
<span id="L186" class="ln">   186&nbsp;&nbsp;</span>void (*(_cgo_get_context_function(void)))(struct cgoContextArg*) {
<span id="L187" class="ln">   187&nbsp;&nbsp;</span>	return __atomic_load_n(&amp;cgo_context_function, __ATOMIC_CONSUME);
<span id="L188" class="ln">   188&nbsp;&nbsp;</span>}
<span id="L189" class="ln">   189&nbsp;&nbsp;</span>
<span id="L190" class="ln">   190&nbsp;&nbsp;</span>// Gets the symbolizer function to call to symbolize C frames.
<span id="L191" class="ln">   191&nbsp;&nbsp;</span>void (*(_cgo_get_symbolizer_function(void)))(struct cgoSymbolizerArg*) {
<span id="L192" class="ln">   192&nbsp;&nbsp;</span>	return __atomic_load_n(&amp;cgo_symbolizer_function, __ATOMIC_CONSUME);
<span id="L193" class="ln">   193&nbsp;&nbsp;</span>}
<span id="L194" class="ln">   194&nbsp;&nbsp;</span>
<span id="L195" class="ln">   195&nbsp;&nbsp;</span>// Call the symbolizer function registered with x_cgo_set_traceback_functions.
<span id="L196" class="ln">   196&nbsp;&nbsp;</span>//
<span id="L197" class="ln">   197&nbsp;&nbsp;</span>// See comment on x_cgo_call_traceback_function.
<span id="L198" class="ln">   198&nbsp;&nbsp;</span>void x_cgo_call_symbolizer_function(struct cgoSymbolizerArg* arg) {
<span id="L199" class="ln">   199&nbsp;&nbsp;</span>	void (*pfn)(struct cgoSymbolizerArg*);
<span id="L200" class="ln">   200&nbsp;&nbsp;</span>
<span id="L201" class="ln">   201&nbsp;&nbsp;</span>	pfn = _cgo_get_symbolizer_function();
<span id="L202" class="ln">   202&nbsp;&nbsp;</span>	if (pfn == nil) {
<span id="L203" class="ln">   203&nbsp;&nbsp;</span>		return;
<span id="L204" class="ln">   204&nbsp;&nbsp;</span>	}
<span id="L205" class="ln">   205&nbsp;&nbsp;</span>
<span id="L206" class="ln">   206&nbsp;&nbsp;</span>	_cgo_tsan_acquire();
<span id="L207" class="ln">   207&nbsp;&nbsp;</span>	(*pfn)(arg);
<span id="L208" class="ln">   208&nbsp;&nbsp;</span>	_cgo_tsan_release();
<span id="L209" class="ln">   209&nbsp;&nbsp;</span>}
<span id="L210" class="ln">   210&nbsp;&nbsp;</span>
<span id="L211" class="ln">   211&nbsp;&nbsp;</span>// _cgo_try_pthread_create retries pthread_create if it fails with
<span id="L212" class="ln">   212&nbsp;&nbsp;</span>// EAGAIN.
<span id="L213" class="ln">   213&nbsp;&nbsp;</span>int
<span id="L214" class="ln">   214&nbsp;&nbsp;</span>_cgo_try_pthread_create(pthread_t* thread, const pthread_attr_t* attr, void* (*pfn)(void*), void* arg) {
<span id="L215" class="ln">   215&nbsp;&nbsp;</span>	int tries;
<span id="L216" class="ln">   216&nbsp;&nbsp;</span>	int err;
<span id="L217" class="ln">   217&nbsp;&nbsp;</span>	struct timespec ts;
<span id="L218" class="ln">   218&nbsp;&nbsp;</span>
<span id="L219" class="ln">   219&nbsp;&nbsp;</span>	for (tries = 0; tries &lt; 20; tries++) {
<span id="L220" class="ln">   220&nbsp;&nbsp;</span>		err = pthread_create(thread, attr, pfn, arg);
<span id="L221" class="ln">   221&nbsp;&nbsp;</span>		if (err == 0) {
<span id="L222" class="ln">   222&nbsp;&nbsp;</span>			return 0;
<span id="L223" class="ln">   223&nbsp;&nbsp;</span>		}
<span id="L224" class="ln">   224&nbsp;&nbsp;</span>		if (err != EAGAIN) {
<span id="L225" class="ln">   225&nbsp;&nbsp;</span>			return err;
<span id="L226" class="ln">   226&nbsp;&nbsp;</span>		}
<span id="L227" class="ln">   227&nbsp;&nbsp;</span>		ts.tv_sec = 0;
<span id="L228" class="ln">   228&nbsp;&nbsp;</span>		ts.tv_nsec = (tries + 1) * 1000 * 1000; // Milliseconds.
<span id="L229" class="ln">   229&nbsp;&nbsp;</span>		nanosleep(&amp;ts, nil);
<span id="L230" class="ln">   230&nbsp;&nbsp;</span>	}
<span id="L231" class="ln">   231&nbsp;&nbsp;</span>	return EAGAIN;
<span id="L232" class="ln">   232&nbsp;&nbsp;</span>}
<span id="L233" class="ln">   233&nbsp;&nbsp;</span>
<span id="L234" class="ln">   234&nbsp;&nbsp;</span>static void
<span id="L235" class="ln">   235&nbsp;&nbsp;</span>pthread_key_destructor(void* g) {
<span id="L236" class="ln">   236&nbsp;&nbsp;</span>	if (x_crosscall2_ptr != NULL) {
<span id="L237" class="ln">   237&nbsp;&nbsp;</span>		// fn == NULL means dropm.
<span id="L238" class="ln">   238&nbsp;&nbsp;</span>		// We restore g by using the stored g, before dropm in runtime.cgocallback,
<span id="L239" class="ln">   239&nbsp;&nbsp;</span>		// since the g stored in the TLS by Go might be cleared in some platforms,
<span id="L240" class="ln">   240&nbsp;&nbsp;</span>		// before this destructor invoked.
<span id="L241" class="ln">   241&nbsp;&nbsp;</span>		x_crosscall2_ptr(NULL, g, 0, 0);
<span id="L242" class="ln">   242&nbsp;&nbsp;</span>	}
<span id="L243" class="ln">   243&nbsp;&nbsp;</span>}
<span id="L244" class="ln">   244&nbsp;&nbsp;</span>
</pre><p><a href="/src/runtime/cgo/gcc_libinit.c?m=text">View as plain text</a></p>

</article>

</main>
<footer class="Site-footer">
  <div class="Footer">
    <div class="Container">
      <div class="Footer-links">
          <div class="Footer-linkColumn">
            <a href="/solutions/" class="Footer-link Footer-link--primary" aria-describedby="footer-description">
              Tại sao Go
            </a>
              <a href="/solutions/use-cases" class="Footer-link" aria-describedby="footer-description">
                Use Cases
              </a>
              <a href="/solutions/case-studies" class="Footer-link" aria-describedby="footer-description">
                Case Studies
              </a>
          </div>
          <div class="Footer-linkColumn">
            <a href="/learn/" class="Footer-link Footer-link--primary" aria-describedby="footer-description">
              Bắt đầu
            </a>
              <a href="/play" class="Footer-link" aria-describedby="footer-description">
                Playground
              </a>
              <a href="/tour/" class="Footer-link" aria-describedby="footer-description">
                Tour
              </a>
              <a href="https://stackoverflow.com/questions/tagged/go?tab=Newest" class="Footer-link" aria-describedby="footer-description">
                Stack Overflow
              </a>
              <a href="/help/" class="Footer-link" aria-describedby="footer-description">
                Trợ giúp
              </a>
          </div>
          <div class="Footer-linkColumn">
            <a href="https://pkg.go.dev" class="Footer-link Footer-link--primary" aria-describedby="footer-description">
              Packages
            </a>
              <a href="/pkg/" class="Footer-link" aria-describedby="footer-description">
                Thư viện chuẩn
              </a>
              <a href="https://pkg.go.dev/about" class="Footer-link" aria-describedby="footer-description">
                Giới thiệu về Go Packages
              </a>
          </div>
          <div class="Footer-linkColumn">
            <a href="/project" class="Footer-link Footer-link--primary" aria-describedby="footer-description">
              Giới thiệu
            </a>
              <a href="/dl/" class="Footer-link" aria-describedby="footer-description">
                Tải xuống
              </a>
              <a href="/blog/" class="Footer-link" aria-describedby="footer-description">
                Blog
              </a>
              <a href="https://github.com/golang/go/issues" class="Footer-link" aria-describedby="footer-description">
                Issue Tracker
              </a>
              <a href="/doc/devel/release" class="Footer-link" aria-describedby="footer-description">
                Ghi chú bản phát hành
              </a>
              <a href="/brand" class="Footer-link" aria-describedby="footer-description">
                Hướng dẫn thương hiệu
              </a>
              <a href="/conduct" class="Footer-link" aria-describedby="footer-description">
                Quy tắc ứng xử
              </a>
          </div>
          <div class="Footer-linkColumn">
            <a href="/wiki/#the-go-community" class="Footer-link Footer-link--primary" aria-describedby="footer-description">
              Kết nối
            </a>
              <a href="https://bsky.app/profile/golang.org" class="Footer-link" aria-describedby="footer-description">
                Bluesky
              </a>
              <a href="https://hachyderm.io/@golang" class="Footer-link" aria-describedby="footer-description">
                Mastodon
              </a>
              <a href="https://www.twitter.com/golang" class="Footer-link" aria-describedby="footer-description">
                Twitter
              </a>
              <a href="https://github.com/golang" class="Footer-link" aria-describedby="footer-description">
                GitHub
              </a>
              <a href="https://invite.slack.golangbridge.org/" class="Footer-link" aria-describedby="footer-description">
                Slack
              </a>
              <a href="https://reddit.com/r/golang" class="Footer-link" aria-describedby="footer-description">
                r/golang
              </a>
              <a href="https://www.meetup.com/pro/go" class="Footer-link" aria-describedby="footer-description">
                Meetup
              </a>
              <a href="https://golangweekly.com/" class="Footer-link" aria-describedby="footer-description">
                Golang Weekly
              </a>
          </div>
      </div>
    </div>
  </div>
  <div class="screen-reader-only" id="footer-description" hidden>
          Mở trong cửa sổ mới.
  </div>
  <div class="Footer">
    <div class="Container Container--fullBleed">
      <div class="Footer-bottom">
        <img class="Footer-gopher" src="/images/gophers/pilot-bust.svg" alt="Go Gopher">
        <ul class="Footer-listRow">
          <li class="Footer-listItem">
            <a href="/copyright" aria-describedby="footer-description">Bản quyền</a>
          </li>
          <li class="Footer-listItem">
            <a href="/tos" aria-describedby="footer-description">Điều khoản dịch vụ</a>
          </li>
          <li class="Footer-listItem">
            <a href="http://www.google.com/intl/en/policies/privacy/" aria-describedby="footer-description"
              target="_blank"
              rel="noopener">
              Chính sách quyền riêng tư
            </a>
            </li>
          <li class="Footer-listItem">
            <a
              href="/s/website-issue" aria-describedby="footer-description"
              target="_blank"
              rel="noopener"
              >
              Báo cáo sự cố
            </a>
          </li>
          <li class="Footer-listItem go-Footer-listItem">
            <button class="go-Button go-Button--text go-Footer-toggleTheme js-toggleTheme" aria-label="Chuyển đổi giao diện">
              <img
                data-value="auto"
                class="go-Icon go-Icon--inverted"
                height="24"
                width="24"
                src="/images/icons/brightness_6_gm_grey_24dp.svg"
                alt="Giao diện hệ thống">
              <img
                data-value="dark"
                class="go-Icon go-Icon--inverted"
                height="24"
                width="24"
                src="/images/icons/brightness_2_gm_grey_24dp.svg"
                alt="Giao diện tối">
              <img
                data-value="light"
                class="go-Icon go-Icon--inverted"
                height="24"
                width="24"
                src="/images/icons/light_mode_gm_grey_24dp.svg"
                alt="Giao diện sáng">
            </button>
          </li>
        </ul>
        <a class="Footer-googleLogo" target="_blank" href="https://google.com" rel="noopener">
          <img class="Footer-googleLogoImg" src="/images/google-white.png" alt="Logo Google">
        </a>
      </div>
    </div>
  </div>
  <script src="/js/jquery.js"></script>
  <script src="/js/carousels.js"></script>
  <script src="/js/searchBox.js"></script>
  <script src="/js/misc.js"></script>
  <script src="/js/hats.js"></script>
  <script src="/js/playground.js"></script>
  <script src="/js/godocs.js"></script>
  <script async src="/js/copypaste.js"></script>
</footer>
<section class="Cookie-notice js-cookieNotice">
  <div>go.dev sử dụng cookie của Google để cung cấp và nâng cao chất lượng dịch vụ cũng như
  phân tích lưu lượng truy cập. <a target=_blank href="https://policies.google.com/technologies/cookies">Tìm hiểu thêm.</a></div>
  <div><button class="go-Button">Đồng ý</button></div>
</section>
</body>
</html>


















