diff --git a/ChangeLog.md b/ChangeLog.md
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,3 +1,7 @@
+### 2.0.17
+
++ Annotate properly the return argument of [`threadSelf`](https://hackage.haskell.org/package/gi-glib/docs/GI-GLib-Structs-Thread.html#v:threadSelf), fixes [issue 173](https://github.com/haskell-gi/haskell-gi/issues/173).
+
 ### 2.0.16
 
 + Remove enable-overloading flags, and use instead explicit CPP checks for 'haskell-gi-overloading-1.0', see [how to disable overloading](https://github.com/haskell-gi/haskell-gi/wiki/Overloading\#disabling-overloading).
diff --git a/GLib.overrides b/GLib.overrides
--- a/GLib.overrides
+++ b/GLib.overrides
@@ -33,6 +33,10 @@
 # Return type (correctly) marked as nullable since 2.54 at least.
 set-attr GLib/TimeVal/to_iso8601/@return-value nullable 1
 
+# The return value does not have its refcount incremented
+# See https://github.com/haskell-gi/haskell-gi/issues/173
+set-attr GLib/Thread/self/@return-value transfer-ownership none
+
 if windows
    # Windows only macros in glib/gfileutils.h
    set-attr GLib/file_get_contents c:identifier g_file_get_contents_utf8
diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
 # Documentation
 Autogenerated documentation for this package can be found at
 
-[https://hackage.haskell.org/package/gi-glib-2.0.16/docs/GI-GLib.html](https://hackage.haskell.org/package/gi-glib-2.0.16/docs/GI-GLib.html)
+[https://hackage.haskell.org/package/gi-glib-2.0.17/docs/GI-GLib.html](https://hackage.haskell.org/package/gi-glib-2.0.17/docs/GI-GLib.html)
 
 For general documentation on using [haskell-gi](https://github.com/haskell-gi/haskell-gi) based bindings, see [the project page](https://github.com/haskell-gi/haskell-gi) or [the Wiki](https://github.com/haskell-gi/haskell-gi/wiki).
diff --git a/gi-glib.cabal b/gi-glib.cabal
--- a/gi-glib.cabal
+++ b/gi-glib.cabal
@@ -1,5 +1,5 @@
 name:                 gi-glib
-version:              2.0.16
+version:              2.0.17
 synopsis:             GLib bindings
 description:          Bindings for GLib, autogenerated by haskell-gi.
 homepage:             https://github.com/haskell-gi/haskell-gi
@@ -9,14 +9,14 @@
 maintainer:           Iñaki García Etxebarria (garetxe@gmail.com)
 category:             Bindings
 build-type:           Custom
-cabal-version:        >= 1.24
+cabal-version:        1.24
 
 extra-source-files: README.md ChangeLog.md stack.yaml GLib.overrides
 
 custom-setup
       setup-depends: base >= 4.7 && < 5,
                      Cabal >= 1.24,
-                     haskell-gi == 0.21.*
+                     haskell-gi >= 0.21.1 && < 0.22
 
 library
       default-language: Haskell2010
@@ -27,7 +27,7 @@
       pkgconfig-depends: glib-2.0
       build-depends: base >= 4.7 && <5,
                      haskell-gi-base == 0.21.*,
-                     haskell-gi == 0.21.*,
+                     haskell-gi >= 0.21.1 && < 0.22,
                      haskell-gi-overloading < 1.1,
                      bytestring >= 0.10 && < 1,
                      containers >= 0.5 && < 1,
