Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(184)

Side by Side Diff: mojo/edk/util/logging_internal.cc

Issue 1426343002: EDK: Move mutex.*, cond_var.*, and thread_annotations.h to //mojo/edk/util. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium 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 "mojo/edk/util/mutex.h"
6
7 #if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)
8 #include <stdio.h>
9 #include <stdlib.h>
10 #include <string.h>
11
12 namespace mojo {
13 namespace util {
14 namespace internal {
15
16 void DcheckHelper(const char* file, int line, const char* condition_string) {
17 fprintf(stderr, "%s:%d: Check failed: %s\n", file, line, condition_string);
18 abort();
19 }
20
21 void DcheckWithErrnoHelper(const char* file,
22 int line,
23 const char* fn,
24 int error) {
25 fprintf(stderr, "%s:%d: %s: %s\n", file, line, fn, strerror(error));
jamesr 2015/11/03 22:34:49 this isn't threadsafe
26 abort();
jamesr 2015/11/03 22:34:49 but fuck it, we're going down anyway
27 }
28
29 } // namespace internal
30 } // namespace util
31 } // namespace mojo
32
33 #endif // !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698