Shared history in Bash

One of the features that I miss most in Bash is the shared history between terminals that Zsh supports. I was hunting down a solution for this and came across this Stack Overflow answer 1 by user lesmana. This code snippet does the trick: